Programming Ass.

Introduction
I have created a program using Visual Basic of a space invaders game, which I've learnt how to do from this tutorial and the subsequent tutorials. The problem of the game is to shoot the invaders before they "invade earth".


Algorithm Outlining the Program
For shooter:
1) Determine whether the left, right or no arrow keys are being pressed
2a) If left, move continuously to left for the duration of how long the arrow key is being pressed
2b) If right, move continuously to right " "
2c) If no arrow key, remain in position
3) Determine whether spacebar is being pressed
4a) If yes, than shoot
4b) If no, don't shoot


For invaders:
1) Move continuously accross top of the screen
2) After hitting edge, move accross next row
3) Repeat 2) until reaching the bottom
4) If hit by shooter, disappear

Overall:
1) If invaders reach the bottom, game over: "Game Over: Earth Invaded"
2) If all invaders are vanquished, game won: "Earth Is Saved"


Explanation of Data Types used
These are my variables:

  Dim SRight As Boolean
    Dim SLeft As Boolean
    Dim ShooterSpeed As Integer
    Dim ShotSpeed As Integer
    Dim InvaderSpeed As Integer
    Dim InvaderDrop As Integer
    Const NumOfInvaders As Integer = 10
    Dim IRight(NumOfInvaders) As Boolean
    Dim Invaders(NumOfInvaders) As PictureBox
    Dim x As Integer
    Dim ShotDown As Integer

"Dim" is used as a variable declaration. Boolean is used for True / False codes. Integers are for numbers.

Control Structure examples
In my program, mainly selection is used rather than sequence or repetition.
e.g.

  If e.KeyValue = Keys.Right Then
            SRight = True
            SLeft = False

"In algorithms, the process of making a decision is called selection." Here, the program is making a decision whether the right or left arrow key is being pressed, depending on whether the right arrow key is being pressed.

Use of Error Detection
Yeah, my program doesn't really use error detection. If you make a mistake it ignores it and continues on with the game. Visual Basics, itself, does though. It won't let you preview your application if there is something wrong in the code.


Overall Evaluation
Overall I am happy with my game as it is simple yet effective. However if I could improve my game, I would add a start menu (with a start button and instructions on how to play), and a restart button for when the game is over.

----------------------------------------------------------------------------

I have just finished my program! (Took a good 2 hours, since I messed up the code.) It's confusing uploading it though...I realised I had to publish the project into an application, and it works perfectly on my computer, however it still doesn't work when you try downloading it from student net. = =" So I will have to submit my program next IT lesson (next term).

Proof that I've actually completed it: