aboutsummaryrefslogtreecommitdiff
path: root/objects.lua
diff options
context:
space:
mode:
Diffstat (limited to 'objects.lua')
-rw-r--r--objects.lua15
1 files changed, 11 insertions, 4 deletions
diff --git a/objects.lua b/objects.lua
index 84c248c..e216b46 100644
--- a/objects.lua
+++ b/objects.lua
@@ -1,5 +1,5 @@
obj = {}
-gt = 0 -- game time
+gt = 0 -- game time, but not actually, this is only used by the background for scrolling.
ft = 1/60 --frametime
scrollspeed = 0
respawntimer = 0
@@ -13,13 +13,12 @@ cartdata("toxicinvaders_bychrisandribbon")
highscore0 = dget(0) --scores (0 is solo - 1 is coop)
highscore1 = dget(1)
currentscore = 0 --used for both gamemodes, but passed into highscore at end of game
+currentsong = -1
function startgame()
- music(0, 0, 3)
- wave[currentwave].start()
+ setwave(currentwave)
gamerunning = true
- -- print(gt,10,10)
end
function updateobjs()
@@ -38,4 +37,12 @@ end
function lerp(start, destination, amount)
return start + amount * (destination - start);
+end
+
+function playsong(song, fade)
+ fade = fade or 0
+ if song ~= currentsong then
+ music(song, fade, 3)
+ currentsong = song
+ end
end \ No newline at end of file