aboutsummaryrefslogtreecommitdiff
path: root/enemies.lua
diff options
context:
space:
mode:
authorChris Bradley <1029chris@gmail.com>2022-02-20 17:51:17 -0800
committerChris Bradley <1029chris@gmail.com>2022-02-20 17:51:17 -0800
commitae91f49c0e637c9b47f8ce5537f4e3a14eea1b92 (patch)
tree5384a0fd4ed625ee8670a83cc9fd292a063cab0a /enemies.lua
parent8b236f9ee426381aacca305a8dc6803797aab62f (diff)
Main menu and win music!!! score scrolls in too
also fixed boss dropping stuff ONCE AND FOR ALL!!!!!!
Diffstat (limited to 'enemies.lua')
-rw-r--r--enemies.lua11
1 files changed, 6 insertions, 5 deletions
diff --git a/enemies.lua b/enemies.lua
index 99d2b51..9da49c6 100644
--- a/enemies.lua
+++ b/enemies.lua
@@ -1,5 +1,6 @@
enemies = {}
canshootatx = 126 --the point on screen when they can start shooting. this needs to be a thing for the final boss portal
+finalbossalive = true --final boss WONT drop shit
function killallenemies()
for i = 1, #enemies, 1 do
enemies[i].health = -1
@@ -26,14 +27,13 @@ function enemycollide(enemy, object) --f this enemy collides with something, do
end
end
-function enemydie(enemy, sound, soundchannel, points, isboss, drop)
- --the drop option is a stupid hack, only the final boss gets to use it.
+function enemydie(enemy, sound, soundchannel, points, isboss)
if enemy.health < 1 then --no health? die.
local x,y = enemy.x,enemy.y
for i = 1, rnd(enemy.h)+6, 1 do
addcircle(x+rnd(enemy.w), y+rnd(enemy.h), rnd(4)-2, -rnd(2)-1, 1, 2, rnd({3, 11, 9}), -0.1)
end
- if rnd(100) < sqrt(enemy.w*enemy.h)/1.5 and not drop then --you get a better chance of a randomly dropped health from bigger enemies
+ if rnd(100) < sqrt(enemy.w*enemy.h)/1.5 and finalbossalive then --you get a better chance of a randomly dropped health from bigger enemies
addpickup(x+rnd(enemy.w), y+rnd(enemy.h), 48)
end
if isboss then
@@ -41,7 +41,7 @@ function enemydie(enemy, sound, soundchannel, points, isboss, drop)
sfx(60,-2) --stop missle sound, less tokens to just have it here.
despawnallbullets = true
killallenemies()
- if not gameover and not drop then
+ if not gameover and finalbossalive then
addpickup(x+rnd(32), y+rnd(32))
addpickup(x+rnd(32), y+rnd(32), 48)
end
@@ -680,8 +680,9 @@ function addfinalboss() --THE FINAL BOSS!!!!!!! WOOOAAAHHHHHH!!!!!!!!!!!!!!!!!!!
moves[(currentwavetime\14)%#moves+1]()
end
end
- enemydie(enemy,17,2,1000,true,1) --die!!!!!!!
+ enemydie(enemy,17,2,1000,true) --die!!!!!!!
else
+ finalbossalive = false
playsong(-1,1000)
killallenemies()
despawnallbullets = true