Skip to main content
gamedev.net
🔒 Locked

2D Animation System

Started by Panax 0 replies 550+ views
Original Post
Panax
Panax
Hey, I''m trying to design an Animation system for a simple 2D game I''m making. So far I have a CSprite class that will load up the sprite and has functions for selecting the active frame of that sprite. I was thinking I should now make a CAnimation class that would handle the logic behind when we move to the next frame of the sprite. So this CAnimation class would have a HAS_A relationship with CSprite (or possibly a IS_A its TBD). And CAnimation''s purpose is to choose when to show the next frame of the sprite, frame rate independatly. I then I was planning on having another class called CPlayer for my main character. CPlayer would have a CAnimation for each animation Player has. For example if I had 3 animations... walk_left, walk_right, and jump, CPlayer would have 3 CAnimation''s... CPlayer''s main purpose would be selecting which animation is currently being used (state management). Does this make any sense or am I way off base here? Can anyone suggest any alternatives? Also how much overhead is associated with QueryPerformanceCounter? Thanks in advance!
GoofProg
GoofProg
You are doing great. At least you have a good idea on your project. I''m still trying to get off my lazy butt and create something =)
The nightmare travels across the cosmos with his burning mane.  The trail of ash that is produced. ?Have a nice day!?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.