Sign in to follow this  

Need new method for Sprite Animation

This topic is 3099 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 guys Okay, so I'm having a major problem with my sprite animation. In java btw. I have a standard animation loop and all that, but I just don't know how to implement "smooth" sprite animation. For example, when you press up once, then the sprite will jump up one tile. Now, the problem with this is that it isn't a smooth sort of glide that I desire. This is how my animation loop works so far: animation class fires an event, | the event listening thread invokes the repaint method | the overriden paint method calls an update method which updates the sprites based on keyboard input etc and draws everything to a image. The paint method paints this image to the panel. | The whole method repeats because of the event firing. Obviously that's it simplified. I also have a class to hold all information pertaining to a sprite character etc. So, as I said above this method doesn't lend itself well to the smoothing out of animation. So I had a new sort of plan I was going to ask about. What about an object that runs independently of everything, takes in all the input etc, and then another class which takes a "snapshot" of what that object looks like currently and displays it to the screen? Does this sound like a reasonable plan? The reason I devised this plan was because my current method doesn't work, but if you can point out a way to smooth out the animation using my method then please point it out. Also, I would like to keep my solution as OO (and scalable) as possible. Thanks PS: Sorry for long post.

Share this post


Link to post
Share on other sites
Quote:
Original post by S-Dawg
What about an object that runs independently of everything, takes in all the input etc, and then another class which takes a "snapshot" of what that object looks like currently and displays it to the screen? Does this sound like a reasonable plan?


Sounds like the Model-View-Controller design pattern.

http://en.wikipedia.org/wiki/Model-view-controller

Share this post


Link to post
Share on other sites

This topic is 3099 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this