[R71] Repeat ignores other conditions

Bugs will be moved here once resolved.

Post » Sun Dec 11, 2011 4:55 am

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?
Scirra Employee
B
129
S
45
G
15
Posts: 705
Reputation: 15,413

Post » Sun Dec 11, 2011 8:19 pm

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.
B
79
S
24
G
54
Posts: 4,749
Reputation: 40,761

Post » Sun Dec 11, 2011 11:48 pm

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?Animmaniac2011-12-11 23:53:21
Scirra Employee
B
129
S
45
G
15
Posts: 705
Reputation: 15,413

Post » Mon Dec 12, 2011 12:50 am

Here's a workaround
You'll probably have to recreate it for every possible occasion.
ImageImage
B
25
S
6
G
8
Posts: 773
Reputation: 6,643

Post » Mon Dec 12, 2011 1:52 am

[QUOTE=Noga] Here's a workaround
You'll probably have to recreate it for every possible occasion.[/QUOTE]
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.Animmaniac2011-12-12 01:53:05
Scirra Employee
B
129
S
45
G
15
Posts: 705
Reputation: 15,413

Post » Mon Dec 12, 2011 9:07 am

Ah, I see, moving back by half pixel makes it perfect, I didn't even think I could use anything else than whole pixels.
ImageImage
B
25
S
6
G
8
Posts: 773
Reputation: 6,643


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 1 guest