aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Bradley <1029chris@gmail.com>2022-02-19 16:29:52 -0800
committerChris Bradley <1029chris@gmail.com>2022-02-19 16:29:52 -0800
commit5bfa4bdc01f19c019e5a8b8e0ac10511d3beaef3 (patch)
treec61ce9bb30aeb0f2771111af3c9e1b3b979a0fc7
parent5ca492d316e5e37edb4054809ca3f18e055bd256 (diff)
Could you spare 6 tokens??
ALMOST DONE!!!!!!!!!! JUST NEED A COUPLE MORE TOKEEEEENSSS!!!!!!!!!!!!!!!!!!!!!!!
-rw-r--r--bullets.lua2
-rw-r--r--draw.lua4
-rw-r--r--enemies.lua112
-rw-r--r--particles.lua4
-rw-r--r--players.lua2
-rw-r--r--update.lua8
-rw-r--r--waves.lua4
7 files changed, 83 insertions, 53 deletions
diff --git a/bullets.lua b/bullets.lua
index ffb7fb9..2884621 100644
--- a/bullets.lua
+++ b/bullets.lua
@@ -39,7 +39,7 @@ function addbullet(x, y, velx, vely, good, sprite)
end
--delete bullet if off screen
- if y > 128 or y < -8 or x > 128 or x < -8 or despawnallbullets then
+ if y > 128 or y < -8 or x > 128 or x < -8 or (despawnallbullets and not good) then
del(obj, bullet)
end
end
diff --git a/draw.lua b/draw.lua
index bb5ecd6..7648cda 100644
--- a/draw.lua
+++ b/draw.lua
@@ -21,11 +21,11 @@ if gamerunning then
runningscore(currentscore,true)
else
runningscore(currentscore,false)
- local scoretextcolors = {{12,15},{2,9}} --shows incorrect shadow colour for 2P counter (shows as 0)
+ local scoretextcolors = {{12,15},{9,2}}
for i = 1, #players, 1 do
local player = players[i]
if player.health < 1 then
- printdropshadow(ceil(player.inv),player.x+circletimex,player.y+circletimey,scoretextcolors[i][i],scoretextcolors[i][i+1])
+ printdropshadow(ceil(player.inv),player.x+circletimex,player.y+circletimey,scoretextcolors[i][1],scoretextcolors[i][2])
end
end
end
diff --git a/enemies.lua b/enemies.lua
index e569c71..de015a0 100644
--- a/enemies.lua
+++ b/enemies.lua
@@ -577,18 +577,30 @@ function addfinalboss() --THE FINAL BOSS!!!!!!! WOOOAAAHHHHHH!!!!!!!!!!!!!!!!!!!
collide = enemycollide,
speed = 1.5,
amount = 3,
- thrustery = {0,0,0,0}
}
+ dramaticdeathtimer = 6
+ thrusterexplode = {}
--thrusters that each fall off once the portal's health is 1/5th depleated
function addportalthruster(x,y,id,isflipped)
- if id*40-40 < enemy.health then
+ local thrusterhealth = id*50-50
+ if thrusterhealth < enemy.health or id == 1 then
local spritethruster = 128
isflipped = isflipped or 1
if flashtime then spritethruster = 132 end --animation
- spr(spritethruster, x, isflipped*(sin(time()*enemy.speed)*3.5)+y, 4, 2)
+ if thrusterhealth > enemy.health - 20 then
+ spritethruster += 32
+ end
+ if (enemy.inv < 0 or flashtime) or thrusterhealth < enemy.health-50 then
+ spr(spritethruster, x, isflipped*(sin(time()*enemy.speed)*3.5)+y, 4, 2)
+ end
elseif rnd() < 0.4 then
addcircle(x+20+rnd(4), y+rnd(6), -0.5, rnd(0.5)-0.25, rnd(7), 1.4, rnd({5,9}))
+ if not thrusterexplode[id] then
+ thrusterexplode[id] = true
+ explosion(x+10,y,32)
+ shake = 12
+ end
end
end
@@ -617,53 +629,67 @@ function addfinalboss() --THE FINAL BOSS!!!!!!! WOOOAAAHHHHHH!!!!!!!!!!!!!!!!!!!
end
function enemy.update()
- enemy.x = lerp(enemy.x, 103, 0.025)--lerps into place
- if enemy.shootcooldown < 0 then
- enemy.shootcooldown = 1
- if #enemies < 2 then
- for i = 1, 10, 1 do
- addbullet(110,64, rnd(0.5)-1, rnd(2)-1)
+ if enemy.health > 0 or dramaticdeathtimer < 0 or gameover then
+ enemy.x = lerp(enemy.x, 103, 0.025)--lerps into place
+ if enemy.shootcooldown < 0 then
+ enemy.shootcooldown = 1
+ if #enemies < 2 then
+ for i = 1, 10, 1 do
+ addbullet(110,64, rnd(0.5)-1, rnd(2)-1)
+ end
+ if rnd() < 0.4 then
+ addmissile(110, 60, targetplayer)
+ end
end
if rnd() < 0.4 then
- addmissile(110, 60, targetplayer)
+ addbasicenemy(115,rnd(30)+50,0.4+rnd(0.6))
+ elseif rnd() < 0.02 then
+ addtargetingenemy(115, rnd(30)+50, 0.2)
end
- end
- if rnd() < 0.4 then
- addbasicenemy(115,rnd(30)+50,0.4+rnd(0.6))
- elseif rnd() < 0.02 then
- addtargetingenemy(115, rnd(30)+50, 0.2)
- end
- if flr(currentwavetime%14) == 5 then
- local moves = {
- function()
- if currentwavetime < 20 then
- addballshooter(110, 56, 0.08)
- else
- addballshooter(110, 40, 0.08)
- addballshooter(140, 72, 0.08)
- end
- end,
- function()
- addwallboss(110, 30, 8, 30, 0.05, false, 3, false)
- end,
- function()
- for i = 1, 7, 1 do
- addwallshooter(100 + (54-i)*i, (i%2==1), 0.4)
- end
- addlasershooter(128,48,100,0.2,false,false)
- addbomb(128, 48, 9)
- end,
- function ()
- for i = 1, 5, 1 do
- addtargetingenemy(128, i*10+32, 0.085)
+ if flr(currentwavetime%14) == 5 then
+ local moves = {
+ function()
+ if currentwavetime < 20 then
+ addballshooter(110, 56, 0.08)
+ else
+ addballshooter(110, 40, 0.08)
+ addballshooter(140, 72, 0.08)
+ end
+ end,
+ function()
+ addwallboss(110, 30, 8, 30, 0.05, false, 3, false)
+ end,
+ function()
+ for i = 1, 7, 1 do
+ addwallshooter(100 + (54-i)*i, (i%2==1), 0.4)
+ end
+ addlasershooter(128,48,100,0.2,false,false)
+ addbomb(128, 48, 9)
+ end,
+ function ()
+ for i = 1, 5, 1 do
+ addtargetingenemy(128, i*10+32, 0.085)
+ end
end
- end
- }
- moves[flr((currentwavetime/14)%#moves+1)]()
+ }
+ moves[flr((currentwavetime/14)%#moves+1)]()
+ end
+ end
+ enemydie(enemy,17,2,1000,true) --die!!!!!!!
+ else
+ killallenemies()
+ despawnallbullets = true
+ --enemy.speed += 0.002
+ dramaticdeathtimer -= ft
+ if enemy.shootcooldown < 0 then
+ enemy.shootcooldown = dramaticdeathtimer/8
+ explosion(103+rnd(8), rnd(128),32)
+ shake = rnd(10)
+ --sfx(17,1)
+ --sfx(21,0)
end
end
enemymisc(enemy)
- enemydie(enemy,17,2,1000,true) --die!!!!!!!
end
add(enemies, enemy)
diff --git a/particles.lua b/particles.lua
index f26718f..a07f95f 100644
--- a/particles.lua
+++ b/particles.lua
@@ -19,12 +19,12 @@ function addcircle(x, y, velx, vely, r, time, color, grav)
end
end
- add(obj, circle, 1)
+ add(obj, circle)
end
function explosion(x,y, w, h)
w = w or 8
- h = h or 8
+ h = h or w
for i = 1, w/2, 1 do
addcircle(x+rnd(w), y+rnd(h), -0.5, 0, rnd(8), rnd(1.5)+1, 5)
end
diff --git a/players.lua b/players.lua
index d87340c..0fcf2e7 100644
--- a/players.lua
+++ b/players.lua
@@ -104,7 +104,7 @@ function addplayer(x, y, sprite, bulletsprite)
end
player.particlecooldown = 0.1
end
- if player.health < 2 then
+ if player.health == 1 then
damagesmoke(player)
end
diff --git a/update.lua b/update.lua
index cbd7e06..cfaddab 100644
--- a/update.lua
+++ b/update.lua
@@ -8,7 +8,7 @@ screenshakex = sin(shake+t())*shake
screenshakey = sin(shake+gt/2.1)*shake
if gameover then
- scrollspeed = mid(-1/10,scrollspeed-1/3000,ft)
+ scrollspeed = lerp(scrollspeed, -1/22, 0.01) -- scroll backwards
currentscore = 0 --depleats score
if respawntimer < 0 then
gameover = false
@@ -18,7 +18,11 @@ if gameover then
end
elseif gamerunning then
updatewaves() -- update the wave function
- scrollspeed = mid(0,scrollspeed+1/2000,ft)
+ local targetspeed = ft
+ if bossmusic then
+ targetspeed /= 2 --half scroll speed when boss
+ end
+ scrollspeed = lerp(scrollspeed, targetspeed, 0.03)
end
gt += scrollspeed + 1/600
diff --git a/waves.lua b/waves.lua
index 1fdfb1d..0676054 100644
--- a/waves.lua
+++ b/waves.lua
@@ -1,5 +1,5 @@
wave = {} --store wave functions here
-currentwave = 1 --THIS IS THE CURRENT WAVE, SHOLD BE 1 UNLESS TESTING SOMETHING
+currentwave = 19 --THIS IS THE CURRENT WAVE, SHOLD BE 1 UNLESS TESTING SOMETHING
currentwavetime = 0
delaytimer = 0
everysecondtimer = 0
@@ -301,7 +301,7 @@ function updatewaves()
music(8,0,3)
end
delaytimer += ft
- if delaytimer > wave[min(currentwave+1, #wave)].delay then
+ if delaytimer > wave[currentwave+1].delay then
everysecondtimer = 0
currentwave += 1
if not wave[currentwave].boss and bossmusic then