Jump to content
  • Advertisement
Sign in to follow this  
wease

What classes should I build for 2D game animations? Any suggestions?

This topic is 4747 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

I want to make a 2D game and know the basics of using directX. However, I have some questions about the class structure I should use. I was thinking of creating the following: -a class 'Animation' which loads the .tga file for an animation into a texture, records position, size, and handles drawing the animation. -a class which contains something like an array of type 'Animation' for a character (ie, left, right, jump, etc). -collisions would be handled by both classes (if a character were to interact with a single animation for example) I'm sure someone has thought about this problem before and maybe there is a better way to handle animations for 2d games.

Share this post


Link to post
Share on other sites
Advertisement
I recommend a Model class, which holds all bunch of Animations. I'd also have a Model::Instance class with information on the current animation/frame being played for a given model. This'll free you to have mutiple animations of the same type running simultaneously.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!