like
Code: Select all
for I, v in pairs(enemies) do
if aabb(player.x,player.y,player.width,player.height) then
player_die()
end
end
function player_die()
game_load()
player.x = 50
player.y = 50
player.speed = 400
end
Code: Select all
for I, v in pairs(enemies) do
if aabb(player.x,player.y,player.width,player.height) then
player_die()
end
end
function player_die()
game_load()
player.x = 50
player.y = 50
player.speed = 400
end