D
DictatorPanda
Guest
I'm making a basic space shooter arcade game and instead of using the built-in collision event I'm using place_meeting. Since this would have to be in the step event and the step event runs every frame I made a boolean variable named hit that will become true once an enemy hits the player's ship.
if (place_meeting(x,y, obj_enemy))
{
hit = true;
if (hit == true)
{
global.player_lives -=1;
hit = false;
}
}
The player is still dying in one hit. Can someone explain to me why, thank you.
if (place_meeting(x,y, obj_enemy))
{
hit = true;
if (hit == true)
{
global.player_lives -=1;
hit = false;
}
}
The player is still dying in one hit. Can someone explain to me why, thank you.