ElCheTibo
Member
Hello everyone,
I'm currently working on a simple top-view shooter. I've decided to add a score and best score feature to it.
When the current room is
Unfortunately, I can't stop my
Here are the code snippets:
What am I doing wrong? Am I forgetting an else statement somewhere?
I'm currently working on a simple top-view shooter. I've decided to add a score and best score feature to it.
When the current room is
rGameOver
, the score is displayed, and if the player presses space, the game restarts...Unfortunately, I can't stop my
bestScore
variable to reset after pressing space!Here are the code snippets:
GML:
// Create event of oGameManager
bestScore = 0;
GML:
// Step event of oGameManager
if (room == rGameOver)
{
if (score > bestScore) bestScore = score; // if the current score is higher than bestScore, it stores the score's value
if (keyboard_check_pressed(vk_space)) // the game resets these variables to their default values
{
diff = 1;
score = 0;
lives = 100;
game_restart(); // i said nowhere to reset bestScore :/
}
}