-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmain.lua
51 lines (39 loc) · 990 Bytes
/
main.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
-- game & gamestate requires
local Game = require 'game'
-- global game states
require 'gamestates.loading'
require 'gamestates.main_menu'
require 'gamestates.options_menu'
require 'gamestates.options_sound'
require 'gamestates.options_keyboard'
require 'gamestates.ingame'
-- game instance
local testgame = nil -- main game object
-- basic LÖVE callbacks used on this game; add more as needed
function love.load()
testgame = Game:new() -- initialize game
end
function love.update(dt)
testgame:baseUpdate(dt)
end
function love.draw()
testgame:baseDraw()
end
function love.keypressed(key, code)
testgame:baseKeypressed(key, code)
end
function love.keyreleased(key, code)
testgame:baseKeyreleased(key, code)
end
function love.mousepressed(x,y,button)
testgame:baseMousepressed(x,y,button)
end
function love.mousereleased(x,y,button)
testgame:baseMousereleased(x,y,button)
end
function love.focus(f)
testgame:baseFocus(f)
end
function love.quit()
testgame:baseQuit()
end