Archived

This topic is now archived and is closed to further replies.

QzarBaron

Sprite system tutorials

Recommended Posts

I need some tutorials on creating a sprite system(kinda like LaMonthe''s BOB Engine) I dont care what API it uses(I use SDL but I also know Win32 and DirectDraw) also it would be good if it was in C or C++(preferably C)

Share this post


Link to post
Share on other sites
Ok so i did not find any tutorials but i have a pretty good idea of how the system is going to work.

First im going to have a Base Class which will hold the basic info of the sprite(x position, y position, speed) and will hold the drawing and loading functions. Then im going to have a linked list of Frame structs which will hold an pointer to an SDL surface and a delay variable. Then on the Base sprite Class ill have a function that will load all the .bmps into the Frame linked list. Then ill have a function that will loop through the linked list and will render all the surfaces to screen with the desired animation delay.

This is one of the methods i think will work the other was using a Vector to hold all the frames(but the vector only holds 1 value instead of the 2 i need)

If anyone has any better way of doing it that would be great.

Share this post


Link to post
Share on other sites