How do I only activate a condition on the 3rd attempt

0 favourites
  • 4 posts
  • I have a series of events and sub events when the player dies before the game over/score screen shows. What I would like to do is only on 3rd time the player dies show a fullscreen Ad via cocoonJS.

    I tried creating a global variable and adding 1 to it everytime the players dies then thought this would work...

    System (Compare Variable) Restart Counter => 3 THEN CocoonJS (show fullscreen ad)

    However because the variable stays at 3 until the the player restarts the level the fullscreen ad condition is always met and continues to try and loop showing a fullscreen Ad.

    Any easy way to do this that im completely just missing?

  • The variable stays at 3 because you're not telling it to do otherwise. On the show ad event, add in an action to reset the variable to 0.

  • yeah tried that, it seems to cut the fullscreen ad off straight away as the variable resets

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • You're probably running the show ad action constantly, then. Rather set it to be at start of layout (assuming your score screen is its own layout) or any "On" condition rather than one that runs every tick.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)