Discuss Scratch

OctoKid20
Scratcher
6 posts

How to make a sprite with costumes go through certain costumes instead of all?

I'm trying to do this walk animation and I set the code to say “NEXT COSTUME” when walking, but I can't do that as I was going to add an idle animation too and it would ruin the walk animation. So I tried adding a custom block to do that and it just broke the game. Is there a proper way to do this?
Scratchmaker2321
Scratcher
24 posts

How to make a sprite with costumes go through certain costumes instead of all?

Try this code:
repeat until <not <key [whatever v] pressed?>>
next costume
if <(costume #) > (lastframeofanimation)> then
switch costume to (firstframeofanimation)
end
if <(costume #) < (firstframeofanimation)> then
switch costume to (firstframeofanimation)
end
<([abs v] of (speed x or something)) < (small decimal value maybe 0-0.9 just choose a value) >
I have created this according to your explanations. You may need to edit this a bit so it suits your game.

Powered by DjangoBB