aboutsummaryrefslogtreecommitdiff
path: root/update.lua
diff options
context:
space:
mode:
authorRibbonCable <ambiguousmachine@gmail.com>2022-02-17 21:29:10 -0800
committerRibbonCable <ambiguousmachine@gmail.com>2022-02-17 21:29:10 -0800
commitb15a0c077587ddf748d34556524416435c01ec17 (patch)
tree8d6b651465404426e1fb3eb4e9ba5c29a7c7158d /update.lua
parent8b53a5ee4a55f455c7b1d1dd02d67778b1ec31f8 (diff)
lots of stuff, check desc
Updated planet art adjusted sprites in sheet added boss sprites added some boss graphic code added score system added ending score screen w/ cart reset reduced wave loss from 2 to 1 reduced pickup amount to just bosses and specific waves only reduced tokens by grouping similar math made acid transition able to be reversed planet seed for babymode and a bunch of other stuff I forget sry its late used a lot of tokens today x.x;
Diffstat (limited to 'update.lua')
-rw-r--r--update.lua43
1 files changed, 30 insertions, 13 deletions
diff --git a/update.lua b/update.lua
index 21a3ca4..e006ed6 100644
--- a/update.lua
+++ b/update.lua
@@ -1,11 +1,17 @@
--scrolling and respawn stuff
respawntimer -= ft
+--similar math elements grouped to lower tokens
+flashtime = ceil(t()*10%2) --for flashing elements (ship, score)
+circletimex = sin(t())*3 -- for elements that move in a circle (respawn timer)
+circletimey = cos(t())*3
+
if gameover then
scrollspeed = mid(-1/10,scrollspeed-1/3000,ft)
+ currentscore = 0 --depleats score
if respawntimer < 0 then
gameover = false
foreach(players, function(obj) obj:respawn() end)
- setwave(mid(checkpoint,currentwave-2,#wave))
+ setwave(mid(checkpoint,currentwave-1,#wave)) --goes back one wave
sfx(29, -2)
end
elseif gamerunning then
@@ -14,19 +20,28 @@ elseif gamerunning then
end
gt += scrollspeed + 1/600
-if not gamerunning and t() > 1 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()
+if scorescreen then --ending screen
+ if btn(4) and btn(5) and not isoutro then --press both buttons to reset cart
+ acidcounter = 2
+ isoutro = true
+ music(-1, 2000) --fades music
+ end
+else --main menu
+ if not gamerunning and t() > 1 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
end
if gamerunning or t() < 1.95 then -- weird if because of freezing bubbles in the menu
updateobjs() --update all objects
+ if currentscore > 9999 then currentscore = 9999 elseif currentscore < 0 then currentscore = 0 end --attempts to avoid hitting the OOM error or being negative
end
--screenshake math
@@ -34,7 +49,9 @@ shake = shake + 0.11 * (0 - shake);
if shake < 1 or not doshake then
shake = 0
end
---add another player if they fire
--- if btn(4, 1) and #players == 1 then
--- addplayer(32, 34)
--- end \ No newline at end of file
+
+--adds zeros to score to look cooler
+function scorewithzeros(string,length)
+ if #string == length then return string end
+ return "0"..scorewithzeros(string, length-1)
+end \ No newline at end of file