I'm sorry but I can't give my code away. Our game has been supported with a Game Engine from our docent Programming.
I assume allegro has matrices?
Check this game: http://www.rocksolid...ames/robokill2/
Play a few missions, but not to "play" but to observe.
Look how the robot is moved. Look from where the bullets are fired. Look what happens when a bullet has touched a wall. Look how many bullets a breakable box can take. Look at your inventory, map, checkpoints, items you can buy. You can drag and drop items, figure out(on paper) how you should make that work.
For all the things I said: use a piece of paper! Writing down is very important when you want to create a game.
If you aren't interested in this game find a game yourself and do the same thing. Look how the game mechanics work. Write it down, and figure out how you will code those mechanics.
You have trouble with applying it to programming games because you don't have a diagram/sketch. So make one after you got all the game mechanics.
You have game-logic, and game-creation-logic. And they are almost exact the same.
When you play a game for example COD, Your weapon has 40 bullets, you've shot 28 and you are in a safe area, you know you need to reload that moment.
So when you program the class Weapon and class Bullet, you know you need a method: Reload();
When you program a game it's important to find a structure through the game-logic.
This is sort of how my Weapon class of a COD game will look like: ( and I'm not even thinking at the game-creation-logic, just thinking how the weapon should work when I play the game. so at game-logic level )class Weapon() // You know there are more than 1 type of weapon so I make this class a virtual class { Weapon(); virtual ~Weapon(); virtual void SetFireRate(int fireRate); // Maybe you can buff your character with faster firepower. virtual void SetBulletDamage(int damage); // When you got a death-streak your character can be buffer with more damage the first kill. static const int DEFAULT_FIRE_RATE = 4; static const int DEFAULT_DAMAGE = 20; virtual void Fire(); virtual void Reload(); virtual bool IsActive(); virtual bool IsPrimary(); virtual bool IsSecondary(); virtual bool IsOutOfAmmo(); virtual int GetMagazine(); // returns the size of how many bullets I have left in my magazine(arsenal) virtual int GetAmmo(); // returns the size of how many bullets I have left in my ammo(so the total amount) }
This is how I do it. just writing down the class + the methods. So I don't think at linking classes yet, or data members.
After I got the methods ready of how I think my game will work. I create a diagram, sketch, structure, plan of how I will program that game.
Thereafter I just start programming class by class, method by method.
Sorry for the long post.
~EngineProgrammer
Aww that helps put it into better perspective , maybe ill start by rewriting the game pong using a more organized way like you did above then send u the code and let you tell me how i did haha call me old fashion but i really get into building some of the older arcade games adding my own twist to them so maybe ill stick with things like pong,breakout, asteroids etc.. for now to get more into game programming then move onto things like RPGS

Find content
Not Telling