This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2010-02-15 20:17:06

dmonaco1983
Scratcher
Registered: 2010-02-13
Posts: 3

Animation Help -- Sprites idle stance

Hello, im currently working on a mini-street fighter game. Nothing advanced, just the ability to select from different characters, move em around and have em hit something till it "dies". Im doing it piece by piece and ive gotten up to the animation stage. I got a nice looking idle and walking setup but my problem lies in switching back and forth.

So when the user is not pressing the right or left key, the sprite reverts to a idle animation. I can somewhat get this to work but it's not nice to look at. The sprite will play through the animation and it looks all jerky like it's spazzing out. Ive included a screenshot and just wondering if anyone has some tips on making this a smoother experience.

As I said above, as long as the right or left key isn't pressed, it'll go into the idle animation. If it is suddenly stopped or started, it shouldn't be all messed up. Sorry if it's confusing but I hope you get what im aiming for.

http://img197.imageshack.us/img197/3691/codep.th.png

Offline

 

#2 2010-02-15 21:06:15

greenflash
Scratcher
Registered: 2009-05-27
Posts: 1000+

Re: Animation Help -- Sprites idle stance

Try this script:

http://i46.tinypic.com/2i117qr.gif

Does that help?  smile

Last edited by greenflash (2010-02-15 21:06:41)


http://i48.tinypic.com/2wrkirk.pnghttp://i46.tinypic.com/6r5zk7.pnghttp://i45.tinypic.com/2vtxr1t.png

Offline

 

#3 2010-02-15 21:08:16

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Animation Help -- Sprites idle stance

try using the animation scripts from this project in your project http://scratch.mit.edu/projects/archmage/291819


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#4 2010-02-15 23:12:41

dmonaco1983
Scratcher
Registered: 2010-02-13
Posts: 3

Re: Animation Help -- Sprites idle stance

In that Pikachu one it looks like it's just one file name for the whole walking animation. So if the button is pressed it goes through em all... hmm.

Thanks so far to the both of you.  smile

EDIT: Wait, I see the next costume. Hmm, gonna meddle around, hehe.

Last edited by dmonaco1983 (2010-02-15 23:14:42)

Offline

 

#5 2010-02-15 23:17:06

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Animation Help -- Sprites idle stance

Don't worry about the files names, I was just too lazy to change them. The walking animation only goes though the walking sprites so I am not sure what you are talking about on that point.


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#6 2010-02-16 21:35:37

dmonaco1983
Scratcher
Registered: 2010-02-13
Posts: 3

Re: Animation Help -- Sprites idle stance

Got everything working now, thanks guys!!  big_smile

Just one question, how do you make walking look smooth? Right now it's just:
[blocks]
<change x by( 25
[/blocks]

But it looks a bit jerky. :x

Last edited by dmonaco1983 (2010-02-16 21:36:23)

Offline

 

Board footer