0
\$\begingroup\$

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?

\$\endgroup\$
  • \$\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
3
\$\begingroup\$

Just set an event which triggers the following GML code:

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

That's it.

\$\endgroup\$
1
\$\begingroup\$

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.

\$\endgroup\$

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.