Notice: fwrite(): Write of 8192 bytes failed with errno=28 No space left on device in /home/rmrk/domains/rmrk.net/public_html/Sources/Cache/APIs/FileBased.php on line 96
Print Page - [GM] Help - Character Movement Animation

The RPG Maker Resource Kit

Other Game Creation => Other Game Making Programs => Topic started by: Shibuya on March 02, 2008, 04:42:05 AM

Title: [GM] Help - Character Movement Animation
Post by: Shibuya on March 02, 2008, 04:42:05 AM
I have already made an object for my character, it has basic movement of left and right now. I have made it to change sprite for the appropriate direction. Now, my problem is, how do I make it change to a my walking sprites while walking and change back to the normal sprite when stopped. I have 8 sprites for walking. Any help is greatly appreciated.

Regards
~Shibuya
Title: Re: Help - Character Movement Animation
Post by: J-Crew on March 12, 2008, 12:31:56 AM
Making it change when walking:

When left or right are held, make the sprite change to the walking ones and set variable:  image_speed  to a number that you think looks good.

Making it change to standing sprite upon stopping:

Make an action for left and right released and change the sprite back and set  image_speed to 0 (or a different number if your stand is animated)

Sorry to make you wait, hope this helps. I'll be able to help more if you need anything else.
Title: Re: Help - Character Movement Animation
Post by: Luna on March 12, 2008, 06:05:56 AM
Do you prefer code or D/D (Drag and Drop)? If you ask me, GML is easier than Drag and Drop but then ..

An example is ..

//Press Left Key

sprite_index=spr_RunL


//Release Left Key

sprite_index=spr_Stand


//Press Right Key

sprite_index=spr_RunR


//Release Right Key

sprite_index=spr_Stand



Yeah, you'll need a bit of tweaking to get the code to work properly with your game. It's simple and I know there are some flaws, but it should still be useful.