One of my students is having a sprite dance to music she imported. The music is rather long, and she wants it to stop when the sprite finishes the dance. I thought use of the timer would be a good idea. She would time the program until the sprite finished the dance. It turned out to be 30 seconds into the program that the sprite stopped dancing. We then tried a repeat until loop, but it's not working. Could you help us? Here is part of the code:
when gf clicked
repeat until timer = 30
wait 0.5 sec
switch to costume backbend
wait 0.5 sec
switch to costume kneeup
wait 0.5 sec
switch to costume kneeback
wait 0.5 sec
switch to costume kickfoot
wait 0.5 sec
Offline
Trying to submit code agian.
when gf clicked repeat until timer = 30 wait 0.5 sec switch to costume backbend wait 0.5 sec switch to costume kneeup wait 0.5 sec switch to costume kneeback wait 0.5 sec switch to costume kickfoot wait 0.5 sec
Offline
The timer is pretty fast. If you use timer = 30, the timer will pass 30 too quickly, so it doesn't sense that the timer reaching 30.
Use this instead:
<not <(timer) < [30]>>This will repeat the script only if 30 or more seconds have not passed yet.
Offline
rdococ wrote:
The timer is pretty fast. If you use timer = 30, the timer will pass 30 too quickly, so it doesn't sense that the timer reaching 30.
Use this instead:<not <(timer) < [30]>>This will repeat the script only if 30 or more seconds have not passed yet.
Or
<(timer) > [30]>
Last edited by turkey3 (2012-03-21 15:37:03)
Offline