Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How do I make four way walking animations?
- BurntToast10
-
4 posts
How do I make four way walking animations?
I've been looking all over the internet, but I can't find any good tutorials on how to make a four-way sort of walking animation. what I mean by four-way walking animation is kind of like in Zelda. how link can walk in four directions. I want to do that but I can't figure out how to animate it. help would be greatly appreciated.
- CoconutGator
-
1000+ posts
How do I make four way walking animations?
Could you link your project so I could get a better idea of what you need?
- BurntToast10
-
4 posts
How do I make four way walking animations?
yeah, I'm not very far in, but I'm trying to create an RPG sort of thing, I literally haven't put any code yet lol. https://scratch.mit.edu/projects/636973641
- codeman1044
-
1000+ posts
How do I make four way walking animations?
There's not much magic to making a sprite have 4 different walking directions. You'll need to animate a set of walking frames for walking up, a set for walking down, and a set for walking to the side.
Really the only thing you can do to save animating more of your sprite is to set the rotation style to left-right (there's a block for that in motion) so that you can use your sideways walking animation for both left and right (left-right style rotation will the sprite horizontally when the degree is negative and will stay normal otherwise).
Just make sure that when playing the animation you restrict which costumes your sprite cycles through so that you don't accidentally show costumes for walking in the wrong direction.
Really the only thing you can do to save animating more of your sprite is to set the rotation style to left-right (there's a block for that in motion) so that you can use your sideways walking animation for both left and right (left-right style rotation will the sprite horizontally when the degree is negative and will stay normal otherwise).
Just make sure that when playing the animation you restrict which costumes your sprite cycles through so that you don't accidentally show costumes for walking in the wrong direction.
- BurntToast10
-
4 posts
How do I make four way walking animations?
sorry i don't quite understand, sorry I'm kinda new to coding
- Fluocerite
-
11 posts
How do I make four way walking animations?
Can you share your project?
- codeman1044
-
1000+ posts
How do I make four way walking animations?
sorry i don't quite understand, sorry I'm kinda new to coding
If you're still learning, don't feel bad for not understanding. Those two things are pretty much guaranteed to go together.
What about it do you not understand? I can try and rephrase what I stated to make it easier to understand.
- BurntToast10
-
4 posts
How do I make four way walking animations?
I know about different costumes and all that stuff. I also know how to make walking animations when walking to the left and right. I am trying to figure out how to make different animations for when you are walking in all four directions. I mainly just need to know the code. and @Fluocerite I already put the link, look up near the top.
- codeman1044
-
1000+ posts
How do I make four way walking animations?
The code is pretty simple. The basic idea is that you just loop through certain frames of your sprite's costumes when walking based on the direction.
For example, let's say you have 4 frames to an animation cycle. Walking up is the first 4 (1-4), walking down is the second 4 (5-8), and left/right is the third 4 (9-12). A very crude outline of playing the animations might look like this:
Note that I said this was crude. The animation cycling speed is far too fast, so that may take broadcasts to slow the animation speed without stuttering the physical movement speed.
For example, let's say you have 4 frames to an animation cycle. Walking up is the first 4 (1-4), walking down is the second 4 (5-8), and left/right is the third 4 (9-12). A very crude outline of playing the animations might look like this:
This cycles between the 4 costumes per direction, changing which frame is shown by cycling the frame variable using mod.
Note that I said this was crude. The animation cycling speed is far too fast, so that may take broadcasts to slow the animation speed without stuttering the physical movement speed.
- Kiska-7275
-
1000+ posts
How do I make four way walking animations?
If you want to test Scratchblocks tag, use this topic
Also always close the Scratchblocks tag, please
Last edited by Kiska-7275 (April 5, 2022 17:09:44)
- lens125-_
-
1 post
How do I make four way walking animations?
please how to walk the sprite by frame
- Discussion Forums
- » Help with Scripts
-
» How do I make four way walking animations?