N
Neocraftz1553
Guest
Hello community. I am making my first shoot em' up on game maker(A gradius fangame) and I need some help with a certain mechanic that's been bugging me. So, I have a ship shoot projectiles at enemies, and when the enemy is hit, the projectile gets destroyed and so does the enemy, and a line of simple code gives the player points:
hud_game.points+=25;
The object that has the name hud_game draws lives and scores.
I'm trying to make it so that when the player reaches a certain amount of points, the player gets rewarded with lives, such as every 1000 points. I tried doing:
if (hud_game.points > 1000)
{
global.pLives += 1;
}
But that just spams the player with lives, because as long as the points are 1001 or over, it'll keep rewarding the player lives, letting them basically kamikaze through enemies without worry.
Is there a way so that once the player reaches or passes a certain number of points, it'll reward the player once?
hud_game.points+=25;
The object that has the name hud_game draws lives and scores.
I'm trying to make it so that when the player reaches a certain amount of points, the player gets rewarded with lives, such as every 1000 points. I tried doing:
if (hud_game.points > 1000)
{
global.pLives += 1;
}
But that just spams the player with lives, because as long as the points are 1001 or over, it'll keep rewarding the player lives, letting them basically kamikaze through enemies without worry.
Is there a way so that once the player reaches or passes a certain number of points, it'll reward the player once?