Using wait in a repeat loop - not working?

0 favourites
  • 2 posts
From the Asset Store
Add calm and a lounge vibe to your games with these 8 tracks
  • Hi,

    I'm trying to get this done:

    But after the 'WaitSeconds*loopindex' action it goes wrong. All three explosions occur at the exact same coordinates.

    So I tried that 'loopindex' but apparently it doesn't work.

    Tried a bunch of things, but I was unable to solve it.

    I'm pretty sure there's something simple to solve this, except I don't know what it could be!

    Any ideas? Thanks.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • That's because everything above the "Wait" action in the loop is actually executed in one tick. So first ShellX and ShellY are changed 3 times, and this happens immediately. After about 0.5 seconds your explosions are created and they use the same last values of ShellX and ShellY.

    There are several ways to fix this. I would probably do this:

    Add shadow and explosion to the same container. Set explosion sprite invisible by default. Spawn shadows (explosions will be created automatically). After a wait set explosion visible - it will appear at the same position as its shadow.

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