aboutsummaryrefslogtreecommitdiff
path: root/pickups.lua
diff options
context:
space:
mode:
authorRibbonCable <ambiguousmachine@gmail.com>2022-02-20 12:55:11 -0800
committerRibbonCable <ambiguousmachine@gmail.com>2022-02-20 12:55:11 -0800
commit4f4a5405a95c47b34e0250e6b0f143e8e5f8dc76 (patch)
tree9cfe9651c194db292621e712ee099984a9359aa5 /pickups.lua
parent23acc296abf209ccf2fa15e3641f266b02add71d (diff)
Lots of updates to the music player. Other than track titles and final songs, it's p much done. Also made some sprint non-flipped to save on tokens.
Diffstat (limited to 'pickups.lua')
-rw-r--r--pickups.lua25
1 files changed, 10 insertions, 15 deletions
diff --git a/pickups.lua b/pickups.lua
index 40d1b75..b913e3d 100644
--- a/pickups.lua
+++ b/pickups.lua
@@ -14,18 +14,12 @@
-- add(obj, randompickups)
function addpickup(x, y, type)
+ --if type is "48," then health. otherwise it'll be a rnd powerup
local pickup = {}
- --x,y = x,y
- type = type or rnd({"fastshoot", "3shoot"})
+ type = type or rnd({49, 50}) --48 = health / 49 = fastshoot / 50 = 3shoot
+ local sprite = type
- function pickup.draw(pickup)
- local sprite = 4 --health
- if type == "fastshoot" then
- sprite = 20
- elseif type == "3shoot" then
- sprite = 36
- end
-
+ function pickup.draw()
spr(sprite, x, y)
end
@@ -38,10 +32,10 @@ function addpickup(x, y, type)
function pickup:affect(player)
local pickupcolor = 8 --health
- if type == "fastshoot" then
+ if type == 49 then --fastshoot
player.shootspeed = 0.17
pickupcolor = 12
- elseif type == "3shoot" then
+ elseif type == 50 then --3shoot
player.shoot3 = true
player.shootspeed = 0.4
pickupcolor = 9
@@ -52,10 +46,10 @@ function addpickup(x, y, type)
addcircle(x, y, sin(i/8), cos(i/8), 2, 0.6, pickupcolor)
end
currentscore+=10 --10 points
- sfx(30, 1)
+ sfx(13, 1)
end
- function pickup.update(pickup)
+ function pickup.update()
x -= 0.3
y += sin(time()/2)*0.2
foreach(players, pickup.collide)
@@ -67,4 +61,5 @@ function addpickup(x, y, type)
add(obj, pickup)
end
- --addpickup(120, 60) \ No newline at end of file
+-- addpickup(128, 60, 48)
+-- addpickup(128, 70) \ No newline at end of file