-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.lua
77 lines (54 loc) · 1.95 KB
/
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
-- Imports
BGE = require("bge.basicGameEngine")
local _BS_ = {}
local _DEBUG_ = false
local _test_tab_ = {}
-------------------------------------------------------------------------------
-- Load Function
-------------------------------------------------------------------------------
function love.load(arg)
BGE:load()
BGE.gameStateSystem:addState("loadGame", require("gameStates.loadGame"))
BGE.gameStateSystem:addState("title", require("gameStates.title"))
BGE.gameStateSystem:addState("learn", require("gameStates.learn"))
BGE.gameStateSystem:addState("practice", require("gameStates.practice"))
BGE.gameStateSystem:addState("test", require("gameStates.test"))
BGE.gameStateSystem:setState("loadGame")
BGE:setUseGameStates(true)
if _DEBUG_ then _BS_:load() end
end
-------------------------------------------------------------------------------
-- Main Loop
-------------------------------------------------------------------------------
function love.update(dt)
BGE:update(dt)
if _DEBUG_ then _BS_:update(dt) end
end
-------------------------------------------------------------------------------
-- Drawing Loop
-------------------------------------------------------------------------------
function love.draw()
BGE:draw()
if _DEBUG_ then _BS_:draw() end
end
-------------------------------------------------------------------------------
-- Other Callbacks
-------------------------------------------------------------------------------
function love.focus(f)
end
function love.textinput(t)
BGE.gameStateSystem:textinput(t)
end
function love.keypressed(key)
BGE.gameStateSystem:keypressed(key)
if key == "escape" then BGE.gameStateSystem:setState("loadGame") end
end
--=============================================================================
-- DEBUG CALLBACKS
--=============================================================================
function _BS_:load()
end
function _BS_:update(dt)
end
function _BS_:draw()
end