This is an area where I really need some help. Really really.
For animated map tiles (water etc) I was thinking about having one image file per frame, loading them in at load time then cycling through them during the render loop. Does this sound about right?
The biggy is character animation. Big in that I have absolutely no idea how to make a start with it.
OpenGL, using orthographic mode.
Depending on what you're animating for the tiles, you may be able to get away with UV scrolling. If not, cycling through different images is probably your best option. The only other option would be to animate them procedurally, which means creating the texture based on some coded algorithm.
Character animation can be done the same way. It might be worth it to look into setting up characters in tree like structure, so you only have to animate certain areas. However, the overhead of managing the tree and the headaches of writing it could make it completely not worth the time.
Yeah I am looking for something relatively simple - tis my first game after all. I've taken oath with myself to actually finish this one too :eek:
EDIT: I mean first game using a graphics API.
You can do animation several ways as skorman has said.
It depends on how you are managing your resources. Using the u,v method is extremely fast, yet requires you to have the texture set to the texture that contains these images. If you are only storing one sprite sequence per image, you won't gain any performance over switching images to do animation.
To render, render the current frame image at m_fPosX+m_pFrames[dwCurFrame]->m_fOffsetX,m_fPosY+m_pFrames[dwCurFrame]->m_fOffsetY.
friend class CAnimSeq;
void Create(DWORD dwNumFrames)
void Update(float fTimeDelta)
if (m_dwCurFrame>m_dwNumFrames) m_bActive=false;
Set the texture to CAnimSeq::m_dwTexID prior to rendering.
You will need more functions to get this working, but it should help.
Thanks Bubba :)
I'll have a fiddle with this and if I have any problems, I'll post them here (oh happy happy joy joy joy).