Jump to content
  • Advertisement
Sign in to follow this  
Greenbird

Simple Walking Animation

This topic is 2571 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi,

I am currently programming in java and was wondering if anyone could help me understand how I could go about creating a simple walking animation from a sprite sheet. When the user pressed the left, right, down, or up keys the sprite moves in those directions and looks as if it were walking. If anyone can point me in the right direction it would be much appreciated.

Share this post


Link to post
Share on other sites
Advertisement
Sprite sheet are basically collection of all the frames that is required for the animation....
So to perform an animation from a sprite sheet, you loop through required images from the sprite sheet..

Steps you need to perform are:
Set a starting frame and only make that frame visible.. This is usually done using Rect
when user presses the key.. Change the position of the rect so that another frame is visible
Similarly loop through all the frame in the sprite sheet as required with a certain speed by changing the position of the rect

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!