diff options
| author | RibbonCable <ambiguousmachine@gmail.com> | 2022-02-17 21:29:10 -0800 |
|---|---|---|
| committer | RibbonCable <ambiguousmachine@gmail.com> | 2022-02-17 21:29:10 -0800 |
| commit | b15a0c077587ddf748d34556524416435c01ec17 (patch) | |
| tree | 8d6b651465404426e1fb3eb4e9ba5c29a7c7158d /pickups.lua | |
| parent | 8b53a5ee4a55f455c7b1d1dd02d67778b1ec31f8 (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 'pickups.lua')
| -rw-r--r-- | pickups.lua | 48 |
1 files changed, 25 insertions, 23 deletions
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 |
