How do I check all the sprite speed is 0

Get help using Construct 2

Post » Mon Apr 07, 2014 1:05 pm

Hi all, I need you help! Thanks

The game like this:
When i touch screen, many sprites start moving (in some way) and going to stop in seconds but they not stop the same time,
When all stop user can touch again and sprite will start again.


I code this:

WHEN_SPRITE_SPEED = 0 AND TOUCH_ANY_WHERE -> SPRITE >>START_MOVING

and the Problem is: when one of sprites is stop, some other is still moving: SPRITE >>START_MOVING is still happen.


how can i do like: Just when all the sprites is stop: SPRITE >>START_MOVING happen?

Many Thanks !
B
3
Posts: 3
Reputation: 181

Post » Mon Apr 07, 2014 1:26 pm

You can do a For Each loop that checks if object speed = 0, then increments a counter. If counter == object.count, then you know all objects are at speed zero.
B
33
S
7
G
8
Posts: 312
Reputation: 8,528

Post » Tue Apr 08, 2014 2:21 pm

Thanks,
I have a easy way to to that by using "else"

SPRITE_SPEED > 0 => DO_NO_THING
else => when_all_stop = 1
B
3
Posts: 3
Reputation: 181


Return to How do I....?

Who is online

Users browsing this forum: Lancifer, Yahoo [Bot] and 59 guests