How do I stop a countdown

0 favourites
  • 5 posts
  • Hey guys! I am currently working on a game were you have food and water, you lost 10 every second, these are Global Variables. I also have a random event system- every 10-30 seconds, a random event will occur. unfortunatley, you still lose food and water while the event happens (Like getting involved in a battle), so once you finish battling someone, you have 200 food but when the battle started you had 600. Any help? Thanks!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • So essentially, you want to stop the countdown during the "Event" and continue the countdown when the "Event" is over?

  • two ways.

    one - use a global variable to determine if the player is in battle and check it in the subtraction event..

    (add a "player is not in battle" condition)

    second - use groups for the events pertaining to the battle and those not and activate/deactivate the groups based on what your game is currently doing..

  • so have a global variable saying: playerInEvent = 0

    Encounter2

    set playerInEvent = 1

    then in my subtraction event, would I use it as a condition so like

    Every 1.0 Second(s), playerInEvent = 0

    subtract 10 food

    subtract 10 water

    Like that, right?

  • and one more question, how would i stop my random events from occurring? I figure i will try the same thing that worked with the food.

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