Pages: 1
I need some help with a school assignment.
Here's part of the assignment.
As discussed in class, if a letter in your name is selected with the mouse pointer, left-mouse click, it should animate and then return to its original location, as long as no other animation is in progress. After all animations complete the 30-second timer should restart.
I know how to do everything except restrict other animations when an animation is in progress. In essence, how do I disable input from a mouse while their is an animation playing.
Offline
First, create a variable, such as "Animating?" and add this script to one sprite.
when green flag clicked set [Animating? v] to (0)Next, add
set [Animating? v] to (1)at the top of all of your animation scripts and
set[Animating? v] to (0)at the bottom.
if <(Animating?) = (0)> All your scripts go here endShoul work.
Offline
OverPowered wrote:
First, create a variable, such as "Animating?" and add this script to one sprite.
when green flag clicked set [Animating? v] to (0)Next, addset [Animating? v] to (1)at the top of all of your animation scripts andset[Animating? v] to (0)at the bottom.
Finally, put the entire animation script, including the parts we just added, insideif <(Animating?) = (0)> All your scripts go here endShoul work.
Exactly, accept to make it easier you can just initiate "animating?" To no, and then when it is switch it to yes.
Also, to be more specific, you need to put the if statement to enclose the mouse input script, not all of your scripts(as far as I am understanding).
And remember, if the input script is long, it may actually happen so that when the loop starts, "animating?" Is at no, but during the running of the script it turns yes. That would cause issues. Therefore, you may need to insert that if statement inside the script somewhere, and maybe on the scripts that animates the other buttons(at least that's what it sounds like...)
Hope that helps,
CAA14
Last edited by CAA14 (2013-04-10 23:52:22)
Offline
Pages: 1