-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgame.lua
63 lines (48 loc) · 1.15 KB
/
game.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
local class = require ( 'lib/middleclass' )
local Stateful = require ( 'lib/stateful' )
local Game = class('Game'):include(Stateful)
-- includes
require ('lib/TEsound')
--debug music
TEsound.sound=true
TEsound.music=true
function Game:initialize()
-- menu ressources
--self:gotoState('
self:gotoState('TestBed')
--self:gotoState('Loading', 'MainMenu', require( 'subclass/menuressources' ), _menu_ )
end
-- Include the methods available in all states here
-- prints output in the console
-- If you are on windows you will need to activate it first, see
-- https://love2d.org/wiki/Config_Files
-- for details (you have to set t.console to true)
function Game:log(...)
print(...)
end
function Game:exit()
self:log("Goodbye!")
love.event.push('quit')
end
function Game:draw()
end
function Game:update(dt)
-- update music/sound
TEsound.cleanup()
end
-- by default, exit when pressing 'escape'
function Game:keypressed(key, code)
print( key )
if key == 'escape' then
self:exit()
end
end
function Game:keyreleased(key, code)
end
function Game:mousepressed(x,y,button)
end
function Game:mousereleased(x,y,button)
end
function Game:quit()
end
return Game