aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pickups.lua2
-rw-r--r--players.lua1
-rw-r--r--update.lua2
3 files changed, 3 insertions, 2 deletions
diff --git a/pickups.lua b/pickups.lua
index 400917c..c5f8ea2 100644
--- a/pickups.lua
+++ b/pickups.lua
@@ -27,7 +27,7 @@ function addpickup(x, y, type)
end
function pickup.collide(player)
- if pickup.x+4 >= player.x-4 and pickup.x+4 <= player.x+4+player.w and pickup.y+4 >= player.y-4 and pickup.y+4 <= player.y+player.h+4 then
+ if pickup.x+4 >= player.x-4 and pickup.x+4 <= player.x+4+player.w and pickup.y+4 >= player.y-4 and pickup.y+4 <= player.y+player.h+4 and player.health > 0 then
pickup:affect(player)
for i = 1, 8, 1 do
local color = 8
diff --git a/players.lua b/players.lua
index 25f206b..7b0d4b4 100644
--- a/players.lua
+++ b/players.lua
@@ -52,6 +52,7 @@ function addplayer(x, y, sprite, bulletsprite)
for i = 1, #enemies, 1 do
enemies[i].health = -1
end
+ sfx(29, 1)
elseif player.health <= 0 then
player.inv = 5
end
diff --git a/update.lua b/update.lua
index 3cdd445..6d8e3c1 100644
--- a/update.lua
+++ b/update.lua
@@ -1,12 +1,12 @@
--scrolling and respawn stuff
respawntimer -= 1/60
if gameover then
- -- sfx(1, 1, 0, 28)
scrollspeed = mid(-1/10,scrollspeed-1/3000,1/60)
if respawntimer < 0 then
gameover = false
foreach(players, function(obj) obj:respawn() end)
setwave(mid(1,currentwave-2,#wave))
+ sfx(29, -2)
end
elseif gamerunning then
updatewaves() -- update the wave function