I have two sprites when either one of them has been clicked they change their costume and display an outline around them representing that they have been selected. I want them to simultaneously swap their positions with each other when they have both been selected.
Offline
Try this:
For the first one:
when gf clicked switch to costume [notselected v] //Your first costume, where the sprite isn't selected.
when [Sprite1] clicked next costume if <<([costume # v] of [Sprite2 v]) = [2]> and <(costume #) = [2]>> broadcast [move_1and2 v] end
when i receive [move_1and2 v] set [gox v] to ([x position v] of [Sprite2 v]) set [goy v] to ([y position v] of [Sprite2 v]) broadcast [2go v] and wait go to x: (gox) y: (goy)Second one:
when gf clicked switch to costume [notselected v] //Your first costume, where the sprite isn't selected.
when [Sprite2] clicked next costume if <<([costume # v] of [Sprite1 v]) = [2]> and <(costume #) = [2]>> broadcast [move_1and2 v] end
when i receive [2go v] go to [Sprite1 v]
Last edited by SciTecCf (2012-07-11 05:36:57)
Offline
It works, thanks!
Offline