aboutsummaryrefslogtreecommitdiff
path: root/objects.lua
blob: e2bcfd4cc338801ab44464d2aa7cf4affae024e1 (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()
    music(0, 0, 3)
    wave[currentwave].start()
    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