Random wait seconds glitch

  • Hey Guys,

    At the start of my 'Actual Game' layout my game chooses a random value of seconds for it to drop power ups.

    Everything works fine except for one thing, if I sit on another layout like the Menu for 20+ seconds (more than the amount of seconds per drop) then start playing the game, all the power ups fall at once then the game continues along normally.

    If I just quickly go from the menu to the actual game without waiting, it all works fine.

    Any ideas?

    Thanks, Dan.

  • Have the spawn or countdown happen in a deactivated group, then active the group when the level begins.

  • I tried exactly that earlier but basically as soon as that group activates it drops all the powerups then goes back to normal just as before.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Don't start the timer until the layout starts.

  • It's not a timer really, its "every Random(10-20) seconds". And this event sheet isn't accessed until the game itself starts, not the menu.

  • Maybe it's a bug Ashley?

  • This is the only thing stopping my game from launching so help would be appreciated :)

  • This is no bug it?s just he machanic from Wait.

    I got this problem also some weeks in front of you, and Ashley tried to help me unstand Wait. This is what i understood:

    It saves your actual time stamp and add to this X seconds, lets call this time stamp Actiontime. As soon as the realworld time hit Action Time the Events get fired. Cause you do this in a loop you save X Actiontimes and their Events. Now you open a Pop-up, you think your game doesn?t run forward but the Real World time does it.

    So after you leave the Pop-up Construct ask something like if actiontime > timestamp(real world time) fire Events. And yeah cause this is true at multiple Actiontimes it fires instead multiple Events.

    I?m not sure how to fixx your problem, for that I would need an example .capx. Than I will try it.

  • If you think it's a bug make a post in the Bugs forum following the full procedure. It's impossible to comment without a .capx.

  • Is it possible to take a new timestamp on the start of a layout? That would seem to fix the problem.

  • This is not hard to fix. Just create a global variable to block the "every x seconds" logic until the game actually starts.

  • JoyfulDreamer I wish it was that easy, but I have tried that by activating a group containing the powerups on the start of the layout, all that does is delay the spam of powerups by a tiny amount.

  • Ended up making the power up only fall if there was not another one in existence. I still get all the powerups falling on the start of the level but only one of each, and I really want to launch my game so I'll call it a 'Head Start'.

  • Surely all you need to do is add another condition to your "drop" event?

    player is on screen, lives =x, object is on layer Y, ect ect.

  • That's what I thought, but it seems no matter what I do that "Every random seconds" triggers as soon as it activates, the countdown starts when the application does so it must be attached to a timestamp.

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