[R71] Repeat ignores other conditions

0 favourites
  • 6 posts
  • C2 r71; Windows 7 32 bit; FireFox 8.0; GeForce 9400 GT

    Core 2 Duo E8400 3.00 GHz; 3,00 GB RAM

    I think this may be a bug.

    I'm trying to make a "pushout" event to prevent attached parts of the player to get into solid objects.

    This is my take at it:

    http://dl.dropbox.com/u/7871870/construct/c2-bug-test-05.capx

    *Instructions: Just run to the left.

    However, it seems that the "Repeat" ignores any conditional of it's sub-events but still executes their actions. So, instead of pushing the player just the right amount out of the solid, it is moving it 20 pixels to the left.

    Can you confirm that something is going wrong?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Sprite2's position is not being repositioned in your repeat loop so when it overlaps with the wall it overlaps through the entire loop, moving 20 pixels. To fix it put a action to position Sprite2 to Sprite in the loop.

  • Silly me. Thanks for pointing that out Rojo, haven't noticed my fail.

    Edit: Taking the opportunity, I'm really missing a "stop loop" action like CC for this kind of situations. Any chance of implementing it on a next release Ashley?

  • Here's a workaround

    You'll probably have to recreate it for every possible occasion.

  • Here's a workaround

    You'll probably have to recreate it for every possible occasion.

    Thanks Noga, but this is not an ideal solution. If you look closely you'll see that the blue square overlap the background by a few pixels. To get it working just add another "set Sprite2 position to Sprite" inside the loop in my example, just like Rojo pointed. I totally overlooked the fact that the position was not being updated inside the loop.

    *I updated my example if you want to see how to make it work.

  • Ah, I see, moving back by half pixel makes it perfect, I didn't even think I could use anything else than whole pixels.

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