aboutsummaryrefslogtreecommitdiff
path: root/update.lua
diff options
context:
space:
mode:
author1029chris <1029chris@gmail.com>2022-02-09 20:08:09 -0800
committer1029chris <1029chris@gmail.com>2022-02-09 20:08:09 -0800
commit454130dff8e601f0df00b377a7e373dea304c9ca (patch)
tree31cd8f514e10ace781da42a61e0191d2f16cb0a3 /update.lua
parent3e37c3fd09e335101f3c0ed199c1607879af2f86 (diff)
more menu stuff
Diffstat (limited to 'update.lua')
-rw-r--r--update.lua14
1 files changed, 9 insertions, 5 deletions
diff --git a/update.lua b/update.lua
index 41dad4c..3cdd445 100644
--- a/update.lua
+++ b/update.lua
@@ -1,20 +1,20 @@
--scrolling and respawn stuff
respawntimer -= 1/60
if gameover then
- scrollspeed = mid(-1/60,scrollspeed-1/6000,1/60)
+ -- sfx(1, 1, 0, 28)
+ scrollspeed = mid(-1/10,scrollspeed-1/3000,1/60)
if respawntimer < 0 then
gameover = false
foreach(players, function(obj) obj:respawn() end)
setwave(mid(1,currentwave-2,#wave))
end
elseif gamerunning then
- updatewaves()
- updateobjs()
+ updatewaves() -- update the wave function
scrollspeed = mid(0,scrollspeed+1/2000,1/60)
end
-gt += scrollspeed
+gt += scrollspeed + 1/600
-if not gamerunning then
+if not gamerunning and t() > 1 then
if btn(4) then
addplayer(18, 60, 16, 18)
startgame()
@@ -25,6 +25,10 @@ if not gamerunning then
end
end
+if gamerunning or t() < 1.95 then -- weird if because of freezing bubbles in the menu
+ updateobjs() --update all objects
+end
+
--screenshake math
shake = shake + 0.11 * (0 - shake);
if shake < 1 then