My issue is when I exit the game the lives and scores still appears in my game menu so how do I clear them after I quit the game and get back to the menu?

  • \$\begingroup\$ "after existing the game" Do you mean exiting the game? \$\endgroup\$ – Philipp Sep 21 '16 at 8:47
  • \$\begingroup\$ yes, the lives and scores keep appears on my game menu. \$\endgroup\$ – David Generous Sep 21 '16 at 8:50
  • \$\begingroup\$ This has no real context to speak of. If you exited the game, then your PC is the one doing something weird. Values shouldn't persist after you closed the program (unless you saved and loaded). \$\endgroup\$ – user64742 Oct 25 '16 at 5:38
  • \$\begingroup\$ My guess is 'exit' in the OP context is going from a playing state to the main menu state. \$\endgroup\$ – Felsir Oct 31 '16 at 17:29

Just set an event which triggers the following GML code:

// Clears current lives and score
lives = 0;
score = 0;

That's it.


You can use the "Enter Room" event and then set the lives and score to an arbitrary value of your choice. You can also set so it doesn't draw with the built in function.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.