Exercises

Exercise 15.1: Bitmap loop sprites

Open the gamedefender3d.cpp file and comment in this line

//#define LOOPEXPLOSION 

Also search down for LOOPEXPLOSION and take a look at the code to see what you’re commenting in. Then recompile and shoot some props and see what happens. You get a nice cSpriteLoop that flips through three bitmaps.

Also watch what happens to your updates per second in the status bar when you shoot something. To check if this is due to the bitmaps or to the cascade of prop fragments, you can comment the LOOPEXPLOSION back out, run it again, shoot something and watch the updates per second.

It turns out that, at least the way the Pop Framework currently implements them, bitmap sprites are a little slow in the OpenGL ...

Get Software Engineering and Computer Games now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.