-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.lua
86 lines (51 loc) · 1.21 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
78
79
80
81
82
83
84
85
game = {}
engine = {}
require("engine/engine_includes")
require("game/game_includes")
local _curTime, _prntcnt
local _gameTitle = "LD27 - Four Bombs"
assertDebug = function() end
function love.load()
-- Disable this on release, removes unnecessary asserts
--assertDebug = assert
_curTime = 0
_prntcnt = 0
input = InputController()
game.load()
end
function love.update( dt )
_curTime = _curTime + dt
timer.check()
game.update( dt )
input:clear()
end
function love.draw()
love.graphics.setBackgroundColor( 30, 30, 40 )
love.graphics.clear()
game.draw()
love.graphics.setCaption(_gameTitle.." ("..love.timer.getFPS().." fps)")
end
function love.mousepressed(x, y, button)
input:handle_mousepressed(x,y,button)
end
function love.mousereleased(x, y, button)
input:handle_mousereleased(x,y,button)
end
function love.keypressed(key, unicode)
input:handle_keypressed(key, unicode)
end
function love.keyreleased(key, unicode)
input:handle_keyreleased(key, unicode)
end
function love.focus(f)
end
function love.quit()
end
function engine.currentTime()
return _curTime
end
local oldprint = print
function print( str )
oldprint("[".._prntcnt.."] "..str)
_prntcnt = _prntcnt + 1
end