I KNOW SOME OF THE PAGES NEED A REVISION.
I WILL DO ALL I CAN TO FIX THIS, FAST.
USER INPUT MAY HELP, YOUR COMMENTS ARE IMPORTANT TO ME.
Welcome to the developer's arena.
Use the menu on the left for easy access to GALVADERS project-files and classes.
GALVADERS source-files are also available in a ZIP package.
Developer's arena pages are designed in order to let other game makers read, understand, and use (if you like) this code.
This is my contribution to the Allegro community, I think it's a nice way to share my ideas.
The galvadrs.cpp is where you will find the program-entry main() and the game initialization code.
The base.cpp file contains the code for classes shared by both SPACE INVADERS and GALAXY games.
Classes from base.cpp:
1. class bullet
2. class enemy
3. class explosion
4. class player
5. class text_msg
6. class formation
Information about these classes available in the class-menu and in the base.h file.
The GALVADERS game engine
The game engine is based on base_image object-lists. Every frame we do the following for each object:
1. Issue a remove() function call that removes the sprite from screen.
2. Issue an action() function call where logic for this object is computed.
The action() method is virtual, thus suitable logic is done for any object derived from base_image class.
3. Issue a draw() function call to put the object back on screen.
Note that first we issue remove() for all objects in reverse Z_ORDER, thus removing objects from "top" to "bottom". After doing the game logic, action(), we draw() the object back according to Z_ORDER. That is, from "bottom" to "top".
base_image plays a major role in the design, this is the basic sprite-class; externaly build from GALVADERS project.
Two versions are available for this class:
1. base_image class that works with a vector of RLE_SPRITE *, (this gives us RLE_SPRITE ** pointer type). This class is used in the GALVADERS game.
Look at create_game_params() method about construction of this vector.
2. base_image class that works with DATAFILE *, using RLE_SPRITE * obtained directly from the Allegro DATAFILE array.
This class works with pre-loaded data file.
Note that base_image has a virtual destructor for appropriate cleanup.
More classes in GALVADERS project are inv_formation, used only by SPACE INVADERS game.
gal_formation, gal_attack and stars, used only in GALAXY game.
The menu class, used by the package to run the menu and game loop.
Information about these classes is available in the class-menu.