How do I stop my game from playing in the background once my game is over?

I’m able to keep playing my video game vs the AI when the You Won or You Lose screen appears and the life meter reaches its set value to end the game because that’s whats triggers the either You Won or You Lose screen with the Play Again button and I’m able to play until the You Won and You Lose screen overlap each other.

How can I make my game stop when its over?

  1. Make sure you have setup the leaderboard by going to :globe_with_meridians: icon -› leaderboard

  2. Make a event:
    When: you lose - appearance - hidden - no

Or: you win - appearance - hidden - no

Do: leaderboard - leaderboard - send
score

1 Like

My video game has no leaderboard just simple “You Won” or “You Lose” text that appears if you win or lose with my Play Again Button.

But my game is playable forever in the background and will run for a infinite amount of time.

1 Like

@James, try use the this method:

  1. Add the counter behavior and name it “Game Active”. (Set Value 0)
  2. In the all events (When we use game activity) add the new condition - If (Controller/Game Active/Equal To/0)
    Example:

When:

    Enemy/Position/Above object/Player

and

    Controller/Game Active/Equal To/0

Do

    Enemy/Movement/Move Up In Over Time/1 m.s
  1. If You Lose, add to the counter 1 point

Example:
(Event1)

   Life Meter/Life Meter/Less Than/1

and

   Controller/Game Active/Equal To/0

Do

   Player/Effect/Explosion/Run
   Cotroller/Sound/End Game/Play
   Controller/Game Active/Set Value/1

(Event2)

  Controller/Game Active/Equal To/1

Do

   Player/Appearance/Opacity/0%
   Cotroller/Sound/BG-mus/Stop Playing
   Enemy/Appearance/Set Hidden/Yes
   Restart Button/Position/Set Position/0.0
   End Game Text/Appearance/Set Hidden/No

1 Like

My AI has a behavior of move towards and my Player has a behavior of drag unsure how to add another behavior if they already have one?

1 Like

Second the “Drag” behavior? Or another?

Fixed everything by setting every object to

When

“You Lose” or “You Won” Appears

Do

Item > Appearance > Set Hidden > Yes

1 Like

Cool, congratulations!:clap::clap::clap::slightly_smiling_face:

1 Like