Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How do I stop an animation?
- MyNameIsNotKaleb
-
Scratcher
22 posts
How do I stop an animation?
I'm trying to make a game with an idle animation, but whenever I move, the idle animation doesn't stop.
This is the code:
This is the code:
when green flag clicked
forever
if <(Walk) = [1]> then
switch costume to [costume20]
repeat (6)
wait (0.07) secs
next costume
end
wait (0.07) secs
else
broadcast [Idle] and wait
end
end
Last edited by MyNameIsNotKaleb (Yesterday 00:23:28)
- MyNameIsNotKaleb
-
Scratcher
22 posts
How do I stop an animation?
Idle Code:
when I receive [Idle]
if <(Idle) = [1]> then
repeat until <(Idle) = [0]>
repeat (3)
switch costume to [costume2]
repeat (9)
wait (0.07) secs
next costume
end
end
switch costume to [costume11]
repeat (8)
wait (0.07) secs
next costume
end
wait (0.07) secs
switch costume to [costume1]
end
end
Last edited by MyNameIsNotKaleb (Yesterday 00:30:43)
- dem_bot
-
Scratcher
100+ posts
How do I stop an animation?
don't use wait blocks.
Instead use
Instead use
switch costume to ( (((days since 2000) * (amount of seconds per day * amount of frames per second) ) mod (how many costumes u want it to cycle)) + (first costume of animation)shift + arrow keys to scroll
Last edited by dem_bot (Yesterday 11:24:07)
- Discussion Forums
- » Help with Scripts
-
» How do I stop an animation?


