aboutsummaryrefslogtreecommitdiff
path: root/objects.lua
blob: 4990280575da4e84c0dc4bf40855153bbbfcd845 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
obj = {}
gt = 0 -- game time
scrollspeed = 0
respawntimer = 0
gameover = false
gamerunning = false

function startgame()
    wave[currentwave].start()
    music(0, 0, 3)
    gamerunning = true
end

function updateobjs()
    foreach(players, function(obj) obj:update() end)
    foreach(enemies, function(obj) obj:update() end)
    foreach(obj, function(obj) obj:update() end)
end

function drawobjs()
    foreach(obj, function(obj) obj:draw() end)
    foreach(enemies, function(obj) obj:draw() end)
    foreach(players, function(obj) obj:draw() end)
end