Discuss Scratch

InspectorSarky
New Scratcher
5 posts

Walking animation help!

Hello! I am working on a game where the main sprite's movement is controlled with the arrow keys. In addition, while walking in a certain direction (let's say forward) the sprite has TWO walking animations. My question is how will I make the character walk and change costumes between the 2nd and 3rd costumes (1st is normal standing pose). Also there has to be a wait before changing costumes that does not affect the general walking motion Any help is greatly appreciated. More information can be given if needed. Thanks!

P.S. here is my current ‘forwards’ code:
whenclickedsetfpsto16 switchcostumeto1foreverifkeydownpressed?thenchangeyby-3switchcostumeto2wait3/fpssecsswitchcostumeto3wait3/fpssecs

Last edited by InspectorSarky (Feb. 7, 2016 05:22:46)

TbisonicGames
Scratcher
4 posts

Walking animation help!

Well, If this is what you mean, your going to have to have multiple costumes, Say if you wanted the player to flip when the other key is pressed, you are going to need separate costumes or edit your character's rotation, which is found in the i in the sprite pic that you click to get the sprite up, but in your case, you are going to have to have 4-8 costumes of walking, 4=Two Left/Right, 2 Up/down or 8=2 left 2 right 2 up 2 down. If you want a pause without stopping the GENERAL waling animation you will have to switch it to an idle costume, or in your case costume 1, which will then wait depending on your script and then continue walking, but try to make idle costume look like the middle of the walking animation if you want a pause between every step…
I hope I helped!
InspectorSarky
New Scratcher
5 posts

Walking animation help!

TbisonicGames wrote:

Well, If this is what you mean, your going to have to have multiple costumes, Say if you wanted the player to flip when the other key is pressed, you are going to need separate costumes or edit your character's rotation, which is found in the i in the sprite pic that you click to get the sprite up, but in your case, you are going to have to have 4-8 costumes of walking, 4=Two Left/Right, 2 Up/down or 8=2 left 2 right 2 up 2 down. If you want a pause without stopping the GENERAL waling animation you will have to switch it to an idle costume, or in your case costume 1, which will then wait depending on your script and then continue walking, but try to make idle costume look like the middle of the walking animation if you want a pause between every step…
I hope I helped!
Thanks! I'll give it a try. Although I wish I could skip costume 1 while walking.
footsocktoe
Scratcher
1000+ posts

Walking animation help!

InspectorSarky wrote:

Hello! I am working on a game where the main sprite's movement is controlled with the arrow keys. In addition, while walking in a certain direction (let's say forward) the sprite has TWO walking animations. My question is how will I make the character walk and change costumes between the 2nd and 3rd costumes (1st is normal standing pose). Also there has to be a wait before changing costumes that does not affect the general walking motion Any help is greatly appreciated. More information can be given if needed. Thanks!

P.S. here is my current ‘forwards’ code:
whenclickedsetfpsto16 switchcostumeto1foreverifkeydownpressed?thenchangeyby-3switchcostumeto2wait3/fpssecsswitchcostumeto3wait3/fpssecs

I think you could break it into two parts and give yourself a place to insert something between costume 2 and 3.
whenclickedsetfpsto16 switchcostumeto1foreverifkeydownpressed?thenchangeyby-3switchcostumeto2wait3/fpssecsifkeycpressed?thenbroadcastchange costumesifkeydownpressed?thenchangeyby-3switchcostumeto3wait3/fpssecs
InspectorSarky
New Scratcher
5 posts

Walking animation help!

footsocktoe wrote:

InspectorSarky wrote:

Hello! I am working on a game where the main sprite's movement is controlled with the arrow keys. In addition, while walking in a certain direction (let's say forward) the sprite has TWO walking animations. My question is how will I make the character walk and change costumes between the 2nd and 3rd costumes (1st is normal standing pose). Also there has to be a wait before changing costumes that does not affect the general walking motion Any help is greatly appreciated. More information can be given if needed. Thanks!

P.S. here is my current ‘forwards’ code:
whenclickedsetfpsto16 switchcostumeto1foreverifkeydownpressed?thenchangeyby-3switchcostumeto2wait3/fpssecsswitchcostumeto3wait3/fpssecs

I think you could break it into two parts and give yourself a place to insert something between costume 2 and 3.
whenclickedsetfpsto16 switchcostumeto1foreverifkeydownpressed?thenchangeyby-3switchcostumeto2wait3/fpssecsifkeycpressed?thenbroadcastchange costumesifkeydownpressed?thenchangeyby-3switchcostumeto3wait3/fpssecs
Thanks!
mstone326
Scratcher
1000+ posts

Walking animation help!

I am doing a tutorial for my 8th grade students and handle animations a tad different but very similar to others. My students also understood this methoday pretty well. I create a variable called frame, from the griffpatch tutorial but I handle it a tad differently.

I change costume by frame. Then when I push the arrow to move I change frame by a decimal of 1. In my mario tutorial we change frame by.33. Since each costume has a whole number by making frame a decimal it will take longer to change costume.

Here is build 2, the YouTube tutorial explains it better.
https://scratch.mit.edu/projects/96102755/
Ultradragon005
Scratcher
1 post

Walking animation help!

https://imgur.com/a/CKqJ183 why dosent it work it first goes to 2 then 3 then one not 2 then 1 then 3
Flipped_
Scratcher
500+ posts

Walking animation help!

Please don't necropost. Make your own topics when you need help.
therobotmonkey1
Scratcher
7 posts

Walking animation help!

well i think it is do not block in a if block like if not ? key or not ? key pressed then switch to costume number: might not though

Code_Weegee
Scratcher
100+ posts

Walking animation help!

please dont necropost, this was made YEARS ago

Powered by DjangoBB