main.lua 1.04 KB
Newer Older
1
Gamestate = require "libraries.hump.gamestate"
2
Signals = require "libraries.hump.signal"
3
vector = require ".libraries.hump.vector"
Philipp Hansch's avatar
Philipp Hansch committed
4
camera = require ".libraries.hump.camera"
5
require ".options"
6

Philipp Hansch's avatar
Philipp Hansch committed
7
Shotimg = love.graphics.newImage("graphics/bullet.png")
8
ShotimgSize = vector.new(Shotimg:getWidth(), Shotimg:getHeight())
9 10
aoeimg = love.graphics.newImage("graphics/bullet.png")
aoeimgSize = vector.new(aoeimg:getWidth(), aoeimg:getHeight())
11

12 13 14 15
winWidth = love.graphics.getWidth()
winHeight = love.graphics.getHeight()
winCenter = vector.new(winWidth / 2, winHeight/2)

16 17
local menu = require('states.menu')
local game = require('states.game')
Philipp Hansch's avatar
Philipp Hansch committed
18
local pause = require('states.pause')
Philipp Hansch's avatar
Philipp Hansch committed
19
local gameover = require('states.gameover')
20

21
function love.load()
22
    Gamestate.registerEvents()
23
    Gamestate.switch(Gamestate.menu)
24

Philipp Hansch's avatar
Philipp Hansch committed
25
    cam = camera()
26 27 28 29
end

function love.update(dt)
    Timer.update(dt)
Philipp Hansch's avatar
Philipp Hansch committed
30
    mousePos = vector(love.mouse.getX(), love.mouse.getY())
Philipp Hansch's avatar
Philipp Hansch committed
31 32 33 34 35 36
end

function love.keypressed(key)
    if key == 'escape' then
        love.event.quit()
    end
37
end