aboutsummaryrefslogtreecommitdiff
path: root/update.lua
diff options
context:
space:
mode:
author1029chris <1029chris@gmail.com>2022-02-09 18:05:07 -0800
committer1029chris <1029chris@gmail.com>2022-02-09 18:05:07 -0800
commit3e37c3fd09e335101f3c0ed199c1607879af2f86 (patch)
tree457b7f9314c4826aa8173291efc066b343db34b7 /update.lua
parent08fee0aa2dbe709173aec43236b47ace8b14e0ac (diff)
MENU WORKS!!!!!!
Diffstat (limited to 'update.lua')
-rw-r--r--update.lua39
1 files changed, 34 insertions, 5 deletions
diff --git a/update.lua b/update.lua
index e00f2e6..41dad4c 100644
--- a/update.lua
+++ b/update.lua
@@ -1,11 +1,40 @@
-updatewaves()
-updateobjs()
+--scrolling and respawn stuff
+respawntimer -= 1/60
+if gameover then
+ scrollspeed = mid(-1/60,scrollspeed-1/6000,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()
+ scrollspeed = mid(0,scrollspeed+1/2000,1/60)
+end
+gt += scrollspeed
+
+if not gamerunning then
+ if btn(4) then
+ addplayer(18, 60, 16, 18)
+ startgame()
+ elseif btn(5) then
+ addplayer(18, 45, 16, 18)
+ addplayer(18, 75, 32, 34)
+ startgame()
+ end
+end
+
--screenshake math
shake = shake + 0.11 * (0 - shake);
if shake < 1 then
shake = 0
end
+
+if not doshake then
+ shake = 0
+end
--add another player if they fire
-if btn(4, 1) and playercount == 0 then
- addplayer(32, 34)
-end \ No newline at end of file
+-- if btn(4, 1) and playercount == 0 then
+-- addplayer(32, 34)
+-- end \ No newline at end of file