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
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) function processStars(_x,_y)
gfx.setColor(gfx.kColorWhite) gfx.setColor(gfx.kColorWhite)
for star = 1, #stars do for star = 1, #stars do

View file

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

View file

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