HI All Again
I would like to create a reset button, so all characters return to their original starting positions. However I cant seem to get the scripts to allow anything.
Id like something like:
WHEN button CLICKED
MOVE sprite1 AND sprite2
TO X:0 and Y:0
any advice?
Thanks
Paul
Offline
Try this:
For the button:
when button clicked broadcast [reset v]For Sprite1:
when i receive [reset v] go to x: (0) y: (0)For Sprite2:
when i receive [reset v] go to x: (0) y: (0)
Last edited by SciTecCf (2012-06-05 13:35:18)
Offline
That should work, a broadcast.
Offline
Or you can use variables:
Button:
when gf clicked set [reset v] to [0] forever wait until <<mouse down?> and <touching [mouse-pointer v]?>> set [reset v] to [1] wait until <<not <mouse down?>> or <not <touching [mouse-pointer v]?>>> endSprite1:
when gf clicked wait until <(reset) = [0]> forever wait until <(reset) = [1]> go to x: (0) y: (0) wait until <(reset) = [2]> set [reset v] to [0] endSprite2:
when gf clicked wait until <(reset) = [0]> forever wait until <(reset) = [1]> go to x: (0) y: (0) set [reset v] to [2] end
Offline
Is it generally better (more efficient, less likely to slow scripts down, etc) to use broadcast for things like this, or variables?
Offline
auntiechristine wrote:
Is it generally better (more efficient, less likely to slow scripts down, etc) to use broadcast for things like this, or variables?
Its better to use broadcasts, variables can get a bit clumsy.
Offline