Run every x seconds for a duration of x seconds

  • Hello,

    I'm building a type of tycoon game - or at least am trying to.

    I want to run an event for an amount of time.

    Say, every 0.5 seconds, I add 1 to LotValue for a duration of 10 seconds.

    Every 5 seconds another house is picked and runs that event.

    Or, I guess I could also set a condition just above 'Every 0.5 seconds' instead of having a duration of 10 seconds.

    But the main problem is, the whole thing runs only once. When testing, every 5 seconds it picks a house and sets the containered LotValue and adds '1' to it only once. Then it's off to another random house.

    I'm still learning and this game is a whole new challenge for me.

    Thanks.

  • Did you try system--repeat?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • All sub-events under 'every 5 seconds' run only once every 5 seconds, so your 'every 0.5 seconds' event can run only every 5 seconds for once. You have to seperate those events. Give your houses a boolean variable and set it to true when an instance is picked:

  • Thanks for your replies.

    This gives me something to work with. I'm also reading up on picking (Youtube Scirra Videos).

    Regards

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