AI tank

While in college we were required to do a mini-project on C++. We decided to make an arcade type tank game. We used allegro for the bitmap library and used Codeblocks as our IDE. We managed to come up with a decent game. Here is the game initial screen


Here is the scene from the first level

Level 1

The game basically is just "kill all bots". The interesting feature are:
1. Intelligent bots that chase you and dodge off bullets.
2. Hidden powerups
‚Äč3. Easy Level Design

A* path finding algorithm is used to enable to bots to chase the player. The game is designed fully based on Object Oriented programming concepts and structures. Each entity visible in the screen is an instance of the parent class 'Object'. And other classes like 'Tank', 'bullet', 'wall' etc inherit the 'Object' parent class. 

The layout of each level can be easily designed through a bitmap image. The image below is the level design bitmap for the level one picture above. As can be seen, the color at each position determines what object is to be placed there. There is separate (predefined) color for brick, stone, water, bots and user tank. Before loading the level, the software reads the bitmap map, and scans the colors at various predefined pixels arranged in matrix formation. It then places instance of various objects at those positions on screen based on the color at the corresponding position in the bitmap image.

Level 1 map

And here are some videos of the game in action

Comments are closed.