This project is read-only.

A console game, based on the original Space Invaders, built in C#. The game consists of alien ships, moving slowly from top to bottom and a player ship located at the bottom of the screen. The aim is to destroy all enemy ships before they reach the player.

I. Game Requirements

• A menu with five different options to choose from.
• Enemy ships which will move and shoot downwards.
• Player ship, shooting upwards.
• Bonus enemy ship.
• Cover to block enemy shots.
• Sound.
• Scoring.
• Means to keep the best three high scores.

II. Game Analysis And Design

The game will consist of three major parts – player ship, enemy ships (aliens) and covers.
Both the player and the alien ships will be able to fire.
The player ship can move horizontally left or right.
The player will have four lives. If all four are lost the game will end. Otherwise, the game will continue until all ships are destroyed.
The alien ships will be constantly moving sideways and downwards. Starting from the left of the screen, when they reach the right end of the console they will drop one line and continue moving to the left.
The movement of the ships will carry on until they reach the player, at which point the game will end with a player loss.
The covers will be represented of three blocks of characters, shielding the player from the enemy shots. As the aliens shoot, they will destroy the covers piece by piece. When a player and alien shot meet they will destroy each other.
There will be a bonus object (flying saucer) that will appear at the top of the screen, when certain amounts of enemies are destroyed.
The flying saucer will not shoot and will move from left to right. If shot, it will give a significant bonus to the player’s score.
The score will increase with the destruction of each enemy. Current game score and the remaining player lives will displayed at the top of the screen.
Top ten high scores will be stored in a file and all of them will be available to view from the menu.
The menu will allow the player to choose from five options: start game, view controls, view high scores, view scoring system and exit.

III. Implementation

Initially, a basic stub version of the game was created, containing the most significant parts and some stub methods and comments, to be used as guideline.
Two classes were created to hold the player ship and the flying saucer. Each of them contained the shape of the object, represented as a string and methods to control its position.
At first a separate thread was used for the movement of the player ship, but it was later replaced with a counter, put in a while loop. This greatly improved the smoothness of the movement.
Once we had that ready, we concentrated on the alien ships, their display and movement. It was decided, that their initial position will be loaded from an external file. The same was to be done with the cover. Afterwards the movement was implemented and finally the bullets.
At random intervals, an enemy ship would shoot a bullet going straight down. At the same time the player would move and fire at the enemy. If a ship is hit, the aliens would stop moving for 350ms, play a sound and display a visual effect.
The final touches of the game were the sound and the menu. Some minor changes were made to the speed of both the alien ships and the player, as well as to the way objects behaved when being destroyed.

IV. Testing

The testing was performed simultaneously with the implementation. After each addition of code, all basic functions as well as those mostly affected by the new code were tested thoroughly.
Most often bugs which were encountered were connected with symbols appearing on unexpected places on the screen. However, they were all solved.
We also had to deal with collision of player and enemy bullets and make sure that they destroy each other and disappear once they collide.

V. Future Development

A few features were not implemented due to time constraints. The major ones were:

• Multiple levels – could involve different enemy formations and initial positions, as well as varying shape and strength of player cover.
• Save/Load feature.
• Additional global high score system using an external server. Could be as simple as downloading the score file from a specified location or as complex as a dedicated process on a server.

Last edited Jan 19, 2014 at 7:34 PM by MlaDANCe, version 3