From b15a0c077587ddf748d34556524416435c01ec17 Mon Sep 17 00:00:00 2001 From: RibbonCable Date: Thu, 17 Feb 2022 21:29:10 -0800 Subject: 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; --- pickups.lua | 48 +++++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 23 deletions(-) (limited to 'pickups.lua') diff --git a/pickups.lua b/pickups.lua index 0ad9210..f4ad10b 100644 --- a/pickups.lua +++ b/pickups.lua @@ -1,29 +1,34 @@ -local randompickups = {} -pickuptimer = 10 -function randompickups.update() - pickuptimer -= ft - if pickuptimer < 0 then - pickuptimer = 10 - if rnd(100) > 85 then - addpickup(128, rnd(80)+20) - end - end -end -function randompickups.draw() -end -add(obj, randompickups) +-- local randompickups = {} +-- pickuptimer = 10 +-- function randompickups.update() +-- pickuptimer -= ft +-- if pickuptimer < 0 then +-- pickuptimer = 10 +-- if rnd(100) > 85 then +-- addpickup(128, rnd(80)+20) +-- end +-- end +-- end +-- function randompickups.draw() +-- end +-- add(obj, randompickups) function addpickup(x, y, type) local pickup = {} x = x y = y type = type or rnd({"health", "health", "fastshoot", "3shoot"}) - sprite = 4 + if type == "powerup" then type = rnd({"fastshoot", "3shoot"}) end + + function pickup.draw(pickup) + sprite = 4 --had to move these checks into draw or they'd have incorrect sprites + if type == "fastshoot" then + sprite = 20 + elseif type == "3shoot" then + sprite = 36 + end - if type == "fastshoot" then - sprite = 20 - elseif type == "3shoot" then - sprite = 36 + spr(sprite, x, y) end function pickup.collide(player) @@ -50,13 +55,10 @@ function addpickup(x, y, type) elseif type == "3shoot" then player.shoot3 = true end + currentscore+=10 --10 points sfx(30, 1) end - function pickup.draw(pickup) - spr(sprite, x, y) - end - function pickup.update(pickup) x -= 0.3 y += sin(time()/2)*0.2 -- cgit