When sprites are in motion and they are suppose to execute a command (for e.g. hide) if touching, the command is not executed unless they are nt in motion.
when gf clicked glide <(1) secs to x:[240] y:[10]> if <touching (sprite2)> hide
Offline
That is because the script waits until the block has finished before executing the next block.
You could use this:
when gf clicked forever point towards [sprite2 v] move (1) steps if <touching [sprite2 v]?> hide endThis topic should be moved to help with scripts.
Last edited by 30-1 (2012-11-14 07:10:34)
Offline
When sprites are in motion and they are suppose to execute a command (for e.g. hide) if touching, the command is not executed unless they are nt in motion.
when gf clicked glide (1) secs to x:(240) y:(150)<(timer) > [10] if <touching [sprite2]?> hide
Offline
It was helpful, but i am making a game where an aircraft at the bottom of the stage is firing missiles at object moving from the top of the stage towards the aircraft. When i use
when gf clicked forever point towards [aircraft] Move (1) Steps if <touching [missile]> hideit doesnt really work. Cuz i I wanted the objects to move gradually towards the aircraft and when the aircraft launches the missile, then the object hides.
Offline
broadcast [glide v] and wait //in the middle of a script when i receive [glide v]// Both in same sprite glide (1) secs to x:(whatever) y:(whatever) set [done v] to [yes] //So it stops checking when you get to the position. Take out if you don't want that to happen. when i receive [glide v] set [done v] to [no]//Again, take out if you want it to keep checking when you get to the position wait until <<touching [enemy v]?> or <(done) = [yes]>> if <(done) = [no]> hide end
Last edited by joefarebrother (2012-11-14 12:14:27)
Offline
I think this would be the simplest solution
when gf clicked glide <(1) secs to x:[240] y:[10]> end when gf clicked forever if <touching (sprite2)> hide end end
Last edited by Llamalover (2012-11-14 13:16:53)
Offline