-
Notifications
You must be signed in to change notification settings - Fork 10
/
main.lua
53 lines (36 loc) · 853 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
51
52
53
require 'middleclass'
require 'game'
require 'level'
require 'gamedebug'
require 'audio'
require 'score'
require 'cursor'
require 'city'
require 'missile'
require 'explosion'
require 'bomb'
function love.load()
world = love.physics.newWorld(-800,-600,800,600,0,1.1)
game = game:new()
debug = gamedebug:new(false) -- set to true to enable debug display
love.mouse.setVisible(false)
end
function love.update(dt)
world:update(dt)
game:update(dt)
end
function love.keypressed(key)
if key == 'escape' then
love.event.push('q')
end
if key == 'space' then
game:shoot()
end
if game.game_over and not game.audio.over:isPlaying() then
game:startOver()
end
end
function love.draw()
game:draw()
debug:draw()
end