Stupid Monkey Game Engine
The Stupid Monkey Game Engine is a set of simple classes that provides services that can
be used display and animate bitmaps, play sounds in WAV format, and gather user input
from the mouse and keyboard. This allows the programmer to concentrate on the game specific
details, and not all the low level headaches.
This engine is built on top of the DirectX API version 7, specifically DirectDraw,
DirectSound, and DirectInput. The engine wraps up the DirectX-specific implementation
details, allowing the user to avoid most contact with DirectX. This includes the entire
DirectX setup process, resource loading, etc. The user merely uses the services provided
by the engine to implement whatever is needed. Just allow the Stupid Monkey to do that
hard stuff for you.
I intend to keep evolving this engine as I learn how to do more things, so if you are
interested, make sure you have the current version.
The Stupid Monkey Game Engine is actually made up of three smaller entities. The first
is the graphics module, which handles all the graphical resources and the displaying of
them. Second is the sound module, which loads and manipulates WAV files. Finally is the
input module, which constantly polls the keyboard and mouse for user commands. The main
engine coordinates these three components and acts as an interface to them. It also handles
the issues involved in frame flipping and so on. The user is only responsible for building
each frame, and the engine will take it from there.
How do you use the Stupid Monkey? Well, it is basically a generic class that handles most
of the game independent elements, as mentioned above. To create a new game, simply subclass
the GameEngine and override the gameWork() method. Then add all the functionality you need
to your subclass.
The first time I attempted DirectX programming a few years ago, it pissed me off how slow
it seemed it would take to get something half decent up and running. Looking at the effort
it took to start from scratch and get to the point of being able to have a window that
displayed one pixel was ridiculous. I figured if it took that much work to do those simple
things, imagine how hard it was going to be to do the big things. So I left it for a few
years. Finally, I figured if I wanted to write games as a hobby, I might as well do it
properly. So I decided to give DirectX another try.
Stupid Monkey was originally started as project through which I could learn the basic
DirectX functionality. Then I wanted to wrap up each component into a reusable module
so that I wouldn't have to rewrite them each time I wanted to build a new game. I have
more fun playing with the specific game details, and I don't want to have to deal repeatedly
with the low level workings.
Once I had finally gotten the Stupid Monkey in its beta form and started building demos
with it, I realized how much I had learned. I also noticed how easy it was to get something
working quickly with my Stupid Monkey. All my old annoyances at DirectX for being too low
level for what I wanted to do were swept away.
I've decided to release the Stupid Monkey Game Engine as an open source project for public
consumption. Maybe some newbies out there might want to use it themselves if they don't
want to have to muddle with too much with the DirectX API. Anyone trying to learn DirectX
should feel free to look around inside and see how some of the basics can be done. Also,
I would appreciate any comments or feedback, especially advice and about any bugs.
Potential Future Features
There will be an add-on that contains several GUI components such as buttons, list boxes,
text fields, and so on.
Another add-on will be classes to help you create new characters and objects for your games.
If you have any comments or suggestions, and especially bug reports and questions about
this document, I would appreciate it if you would let me know. You can find out contact
information from the menu on the left.
This is an entirely open source project. Feel free to use and abuse it as you see fit.
All the code is provided for anyone who wants to take a look. All I ask is that if you
use it, please give credit and indicate that a Stupid Monkey powers your project. And
if you do use it, be sure to let me know so I can have a look and see what it is being