condition for every sprite

For questions about using Classic.

Post » Sat Aug 27, 2011 4:08 pm

i want to trigger an action while the condition is true...
i have a sprite and when is rotated to 0, then condition is true...

but now i have 3 same sprites and when one of them is 0, then condition is true. how can i make condition true ONLY when all of the sprites are on 0? is it possible?
B
4
S
2
G
1
Posts: 143
Reputation: 1,211

Post » Sat Aug 27, 2011 4:29 pm

If you have 3 different sprite objects, just combine their conditions in the event:
+ Sprite1 Angle 0
+ Sprite2 Angle 0
+ Sprite3 Angle 0
-> Do whatever

If you have 3 instances of the same sprite, your could create a global (e.g 'anglesMatch') and then do
+ Always
-> System 'anglesMatch' = 0

+ For each Sprite
++ Sprite Angle 0
--> System add 1 to 'anglesMatch'

+ 'anglesMatch' = 3
-> Do whatever

Edit: Note that this doesn't pick the instances.tulamide2011-08-27 16:29:59
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Sat Aug 27, 2011 5:22 pm

thank you very much!
now it works perfect...
i tried that, but my problem was that instead of "always" i had it "start of layout" and then after each click global variable run higher and higher...
i am not a big programming mind :)
thanks for help!
B
4
S
2
G
1
Posts: 143
Reputation: 1,211


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests