Problem with Lives in a game!
rajit.garg11
Member Posts: 11
Hi. I am making this game so that when lives run out, it changes scenes. When I put in the following code, It just made the screen freeze. Can anybody please help me?
When all of the following are happening:
if game.Lives = 0
Change Scene go to Game Over
When all of the following are happening:
if game.Lives = 0
Change Scene go to Game Over
Comments
But I would suggest making a custom pause behaviour and when lives = 0
Then make the custom pause active and display an image saying game over. If you don't know how to do this there is plenty of videos on youtube about it.
GSINVENTION FREE TEMPLATES
Complete Guide to iOS Publishing {} Complete Guide to Mac Publishing
Aside from that it looks fine so maybe you've got something on the Game Over scene it doesn't like. Try creating a new blank scene and send your code to that instead of the current Game Over scene to see if that works.
After you do that, if you're still having trouble you can resort to Log Debugging Statements. Just add them at key points in your game (e.g. right before a game over condition and right after) and then watch the debugger window to see which statements appear right before the crash. That will give you a clue about what might be causing it.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User