Animation running, while object is on collision

Get help using Construct 2

Post » Sun Dec 16, 2012 3:51 pm



While testing that action, browser\game stop responding. What i done wrong.

I tried to find answer to that, and tried other methods of realization, but do to my mediocre knowledge of english, unable to do so. Please help, thx.
B
3
G
1
Posts: 6
Reputation: 494

Post » Sun Dec 16, 2012 4:23 pm

Take that While condition out? I've NEVER had a need for While in Construct, and it certainly doesn't need to be used there since on collision is only triggered when a collision happens so it's basically redundant. Besides, it would need to come before the condition being tested, not after.

As I see it, your condition is reading -

On collision
AND
While

While what? The While condition is causing it to loop infinitely causing the freezing of the game because it's stuck there.

While is useful for sorting like (excuse the simplicity but hopefully you get the idea)..

sorted = FALSE
While NOT sorted
..Sort through hiscores
..If hiscores are in proper order then sorted = TRUE
While Endprocrastinator2012-12-16 16:24:32
B
15
S
5
G
7
Posts: 877
Reputation: 5,650

Post » Sun Dec 16, 2012 4:34 pm

procras get's it right

http://en.wikipedia.org/wiki/While_loop

@OP. I think you may have take the reference of "while" a little too literal in reference to the English language. While while() does make some sense in what you want. It's not used correctly.

Use a while loop when you need compare condition. Also again procas is right. C2 has other caveats that allow development without a while loop. As a programmer I haven't used one yet in C2 though I have been tempted :D

so yes. "While your in collision do this" which is what you have. The while goes into a loop until false. As your object is now in a true condition. It then does your action and THEN it checks to see if the condition is true again. Which it is because your object is still in collision. Then it does the action, then checks the condition.. so on infinitum.
B
87
S
18
G
9
Posts: 2,455
Reputation: 14,834

Post » Sun Dec 16, 2012 7:47 pm

Thanks!
I finally able to achieve desired result! Found invert function )
New versions of construct get me confused some times, so do the old ones )

So this is my result:

Hopefully my english not so weird as google translate says, thx again!
B
3
G
1
Posts: 6
Reputation: 494


Return to How do I....?

Who is online

Users browsing this forum: dadanwsd and 21 guests