Code: Select all
if ply.y + ply.h + enemy.y and ply.y < enemy.y + enemy.y and ply.x + ply.w > enemy.x and ply.x < enemy.x + enemy.w then -- collision
ply.healthscore = ply.healthscore + ply.damage *dt --health subtraction
end
Code: Select all
if ply.y + ply.h + enemy.y and ply.y < enemy.y + enemy.y and ply.x + ply.w > enemy.x and ply.x < enemy.x + enemy.w then -- collision
ply.healthscore = ply.healthscore + ply.damage *dt --health subtraction
end
Code: Select all
if ply.y + ply.h > enemy.y and
ply.y < enemy.y + enemy.y and
ply.x + ply.w > enemy.x and
ply.x < enemy.x + enemy.w then -- collision
ply.healthscore = ply.healthscore + ply.damage *dt --health subtraction
end
Code: Select all
if ply.y + ply.h > enemy.y and
ply.y < enemy.y + enemy.y and
ply.x + ply.w > enemy.x and
ply.x < enemy.x + enemy.w then -- collision
if ply.invulnerable <= 0 then
ply.healthscore = ply.healthscore + ply.damage
ply.invulnerable = 1 -- this is a second
end
end
-- reduce the invulnerable value every update cycle
ply.invulnerable = ply.invulnerable - dt
Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 3 guests