How To Create Three Strikes You Are Out

HamminationHammination Member, PRO Posts: 4

How do I add a behavior where after an actor collides with another actor five times, the game is over, it jumps to the game over screen?

Comments

  • adent42adent42 Key Master, Head Chef, Executive Chef, Member, PRO Posts: 3,155

    First you need an attribute to track the strikes: Create an attribute like game.Strikes

    Then you need to actually count the strikes. Create a rule that triggers on your strike condition and increments game.Strikes. To increment game.Strikes, use Change Attribute. The target should be game.Strikes and the value to set should be an expression: game.Strikes + 1

    Finally you need a Rule that checks if you have enough strikes. Create a Rule that checks if game.Strikes >= 5

    Inside that rule, use Change Scene to jump to the Game Over screen.

    Hope that helps!

Sign In or Register to comment.