DISCLAIMER: If you are going to read this code to learn from it, I should warn you you might pick up some bad habits. Furthermore, the "game" this source comprises is a sandbox. It has few rules, no point, and is quite silly-looking. I'm only using it to develop the engine, at which point I plan to throw the "game" away and build a new game on this engine.
* You will need the DirectX 6 SDK to compile the program. The DirectX 8 SDK doesn't seem to work for me due to Microsoft's design changes. The project files included are for Microsoft Visual C++ 6 *
The attached code is an adaptation of Andre Lamothe's Game Programming for Dummies engine. It may help to have read this book to understand the source, but should not be a requirement. I have re-written it in C++ so I can take advantage of polymorphism to easily create new object types. I didn't post this to the Game Programming section because my problem is more with C++ concepts of polymorphism, derived classes, copy constructors, etc. I've done a lot of research on this problem and I can't seem to track it down! The problem is that only one of the BOBTYPE_POPUP objects created in Game_Init() appears on the screen. The objects appear to have been created properly, and if you read the .LOG file everything appears to be hunky-dory, but only the first popup appears on the screen and the others cannot be seen or collided with. Also, there are minor bugs with colliding objects (i.e. you and the Chef) sticking together, or disappearing off the edge of the screen. Any help on these two points, or other suggestions to improve the organization or design of the source would be greatly appreciated. For those of you wishing to learn from this source, feel free to ask me any technical questions, and I will answer them as best I can. If you improve on this design, please post your improvements so we can all benefit from it.