more particles

This commit is contained in:
PossiblyAxolotl 2022-07-01 23:03:59 -06:00
parent 4a40829dc5
commit 92c3ed3806
3 changed files with 17 additions and 0 deletions

View file

@ -34,6 +34,19 @@ function explode(_x,_y)
end
end
function miniExplode(_x,_y)
for i = 1, 6, 1 do
local part = {
x = _x,
y = _y,
dir = math.random(0,359),
size = math.random(7,10),
speed = math.random(1,3)
}
exps[#exps+1] = part
end
end
function processStars(_x,_y)
gfx.setColor(gfx.kColorWhite)
for star = 1, #stars do

View file

@ -42,6 +42,7 @@ local function die()
active = false
velocity = {x=0,y=0}
sprRocket:moveTo(startpos.x, startpos.y)
miniExplode(startpos.x,startpos.y)
end
function addPlayer(_x,_y,__x,__y)

View file

@ -97,8 +97,11 @@ function updateSaws()
fuels[fuel]:setImage(loopFuel:image())
if #fuels[fuel]:overlappingSprites() > 0 and fuels[fuel].active then
fuels[fuel].active = false
miniExplode(fuels[fuel].x,fuels[fuel].y)
fuels[fuel]:remove()
energy += 1
table.remove(fuels,fuel)
break
end
end