aboutsummaryrefslogtreecommitdiff
path: root/objects.lua
diff options
context:
space:
mode:
authorChris Bradley <1029chris@gmail.com>2022-02-19 23:38:27 -0800
committerChris Bradley <1029chris@gmail.com>2022-02-19 23:38:27 -0800
commit60ad56210bcf4ace33a1474bf57d6091e66e2e79 (patch)
treebddf9aa5e90c993e5bbdab716bc744d1f6c7a408 /objects.lua
parent395ffd247492b0708b6290824ae61af8fccc1869 (diff)
final boss stuff, and token hunting. what else is new? lots of tweaks too
the now constant hunt for tokens continues, good thing we're almost done
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