aboutsummaryrefslogtreecommitdiff
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
parent8b236f9ee426381aacca305a8dc6803797aab62f (diff)
Main menu and win music!!! score scrolls in too
also fixed boss dropping stuff ONCE AND FOR ALL!!!!!!
-rw-r--r--draw.lua5
-rw-r--r--enemies.lua11
-rw-r--r--objects.lua1
-rw-r--r--pico-bhell.p820
-rw-r--r--waves.lua21
5 files changed, 37 insertions, 21 deletions
diff --git a/draw.lua b/draw.lua
index 9beb927..f5e67f1 100644
--- a/draw.lua
+++ b/draw.lua
@@ -30,7 +30,7 @@ if gamerunning then
end
end
end
-if not gamerunning or menuscroll < 1 then
+if not gamerunning or currentwave == 1 then
menuscroll += scrollspeed
@@ -58,7 +58,8 @@ end
--final score screen and outro transition
if currentwave == 20 then
- finalscorescreen(0,0)
+ menuscroll = lerp(menuscroll,1,0.05)
+ finalscorescreen(menuscroll,0)
--outro acid transition
if isoutro then
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
diff --git a/objects.lua b/objects.lua
index 313e59e..367dd87 100644
--- a/objects.lua
+++ b/objects.lua
@@ -47,6 +47,7 @@ function playsong(song, fade)
currentsong = song
end
end
+playsong(29) --main menu music
function addplayer1() --reduces tokens since called once per gamemmode
addplayer(18, 60, 16, 17, 18, 3)
diff --git a/pico-bhell.p8 b/pico-bhell.p8
index eac7ef2..06be64f 100644
--- a/pico-bhell.p8
+++ b/pico-bhell.p8
@@ -342,7 +342,11 @@ d10e0020214222442228422304022142224422284223040221422244222842230402214222442228
5d1c0008100530723413232072321c655072341323207242100001330007300093001c60013300184000e300100000d200192000d200226000d2001e40010300100000d300104000f30022600193002b2001f200
5d1c1000100000723413232072321c6000723413232072321000007234132321f2321c600072341f23213232100000d200192000d200226000d2001e40010300100000d300104000f30022600193002b2001f200
5d381000072440724213242072421c675072441c6751f242072440724213242072421c675072001c6001f200100000d200192000d200226000d2001e40010300100000d300104000f30022600193002b2001f200
-2138000022100221002910029100291002910029100291001b1001b10028100281002810004100101001c1001d1001d1002110021100211001d10021100291001f1001f100221002210022100221002210000000
+471200001f0111f0121f0121f0121f0121f0121f0121f0122101121012210122101215012210122d0122d0131d0121d0121d0121d0121d0121d0121d0121d0121f0111f0121f0121f012130121f0122b0122b013
+411200002201122012220122201222012220122201222012250112501225012250120d01219012250122501321012210122101221012210122101221012210122201122012220122201216012220122e0122e013
+41120000260112601226012260122601226012260122601228011280122801228012100121c01228012280132401224012240122401224012240122401224012260112601226012260120e0121a0122601226013
+5d1200000702213022070221302207022130220702213022090221502209022150220902215022090221502205022110220502211022050221102205022110220702213022070221302207022130220702213022
+5d120000100731302207022130221c675130220702213022100731502209022150221c675150220902215022100731102205022110221c675110220502211022100731302207022130221c675130220702213022
__music__
00 20616263
00 20256263
@@ -373,12 +377,12 @@ __music__
00 35346161
00 35366161
02 35236161
-00 35346161
-00 35366161
-00 41424344
-00 41424344
-00 41424344
-00 41424344
+01 7a3d7d7d
+00 3a3d3c3b
+00 413e657e
+00 3a3e3c3b
+00 413e657e
+02 3a3d3c3b
00 41424344
00 41424344
00 41424344
@@ -407,5 +411,5 @@ __music__
00 41424344
00 41424344
00 41424344
-00 05191514
+04 05191514
diff --git a/waves.lua b/waves.lua
index 60d7252..0a475a2 100644
--- a/waves.lua
+++ b/waves.lua
@@ -13,6 +13,13 @@ wave[1] = {
start = function()
addbasicenemy(150, 60, 0.15)
end,
+ everysecond = function ()
+ if currentwavetime > 1.9 then
+ playsong(0)
+ end
+ end,
+ song = -1,
+ fade = 1800
}
for i = 2, 16, 1 do
@@ -268,13 +275,15 @@ wave[19] = {
canshootatx = 110
addfinalboss()
end,
- song = 17
+ song = 17,
+ fade = 500
}
--ending score screen
wave[20] = {
delay = 4,
start = function()
+ menuscroll = 128 --so that the score menu can scroll in
if not coopmode and highscore0 < currentscore then
dset(0, currentscore) --set singleplayer score
elseif coopmode and highscore1 < currentscore then
@@ -282,7 +291,8 @@ wave[20] = {
end
end,
conditions = function()
- end
+ end,
+ song = 31,
}
foreach(wave, function(wave) if not wave.conditions then wave.conditions = function() if #enemies < 1 then return true end end end end) --if there are no conditons for a wave, give them one. look at all those ends!!!!
@@ -298,8 +308,8 @@ function updatewaves()
end
end
if wave[currentwave].conditions() then
- if wave[currentwave+1].song then
- playsong(wave[currentwave+1].song)
+ if wave[currentwave+1].song and currentwave ~= 19 then --dont want the final wave to play the next song for dramatic effect
+ playsong(wave[currentwave+1].song, wave[currentwave+1].fade or 0)
end
delaytimer += ft
if delaytimer > wave[currentwave+1].delay then
@@ -312,6 +322,5 @@ function setwave(num)
currentwave = num
everysecondtimer,currentwavetime,delaytimer = 0,0,0
wave[currentwave].start()
- local song = wave[currentwave].song or 0
- playsong(song)
+ playsong(wave[currentwave].song or 0, wave[currentwave].fade or 0)
end \ No newline at end of file