by ppcStudios » Aug 6, 2003 @ 6:19pm
Honestly, sprite engines aren't rocket science, they just require some research and planning to get everything working efficiently. The biggest issue is the research - almost everyone is so focused on 3D engines, that 2D has fallen by the wayside and reference material is becoming much harder to locate, both in print and on the web.
Since I've been doing 2D for years, I have a ton of old game development books laying around for reference. If you don't have a good library of older dev books, you might want to consider either scouring Ebay or possibly used bookshops in your area.
On the web you should search for sprite engines, isometric engines and 2D development. You likely won't find exactly what you need, but you'll find enough bits and pieces to gain a solid understanding of what is needed for a working sprite engine.
As an overview, a sprite engine handles the drawing of an unlimited number of sprites, as well as handling collision interactions and physics. This could be as simple as creating a linked list of sprites that are traversed every cycle.
You'll probably want to consider each sprite as a series of n-frames of animation. This means you could have a sprite with 1 frame of animation (a static image) or 100 frames of animation (a very smooth animation). This animation could process forward or backward, could be looping or bidirectional, or could simply be a single pass animation (such as a door opening). Each frame would process in a certain time frame, and you may want to consider skipping frames on slower devices if required. You may want to blt each frame individually, or possibly overlapping frames to create a motion-blur effect. Your animations could utilize simple transparency or more sophisticated blending techniques.
There's much, much more you could do, and you can make a sprite engine as simple or as complex as you like. It could be somewhat generic, or could be specific to your application.
Hope this helped a bit...