Hello. I was trying to make a walking animation of my sprite of sora from kingdom hearts chain of memories, but i just cant get it to work. What i am trying to do is to have the sprite change costumes and move if i am holding down the left key, but when i let the key go i want it to go back to the first costume. If anyone has any ideas it would be much appreciated. Thanks
Offline
hello and welcome!
Please post questions like this in the Help with Scripts Forum!
Offline
There are a variety of ways to do this, but one of the best ways is to have a single costume (or set of costumes if you want a walk cycle) for both directions. Scratch has a button in the sprite control pane that makes a sprite only face left or right.
^ You want to select the button that looks like this: <-->
With this, you can make a script that rotates the sprite and moves it. It'll look something like this:
when gf clicked forever if <(right arrow v) pressed> switch to costume [moving v] point in direction [90] move [whatever] steps else if <(left arrow v) pressed> switch to costume [moving v] point in direction [-90] move [whatever] steps else switch to costume [stopped v] end end endDoes that help?
Offline