Spaceship

Specification: Spaceship
Hi-Rez games are designing a retro shoot-em-up game based on the 1980's classic Space Invaders. At different points in the program a spaceship will appear along the top. If the player successfully shoots the spaceship they are awarded a bonus score as follows:

No lives remaining = 100 points 1 life remaining = 400 points 2+ lives remaining = 1000 points

The design team have decided to develop a function to calculate the bonus score.

Design a simple prototype of the scoring mechanism.

Algorithm
1. get lives 2. get score from GetSpaceshipLives 3. display score
 * Hit Spaceship Button**

1. if player lives = 0 then 2. score = 100 3. else if player lives = 1 then 4. score = 500 5. else score = 1000 6. end if 7. return score
 * GetSpaceshipScore Function**
 * Parameter: PlayerLives, Integer **
 * Return Type: Integer **

Task
1. Add the following code to the Hit Spaceship button:



2. Create the function as follows: (i) Click the Project Tab (ii) Click Add Module (iii) Double Click Module1 (iv) Click Add Method (Real Basic calls a function a method) (v) Under Method Name enter GetSpaceshipScore (vi) Under Parameters enter PlayerLives As Integer (vii) Under Return Type Integer

The top of the method should look like this:



3. Add the following code to the GetSpaceshipScore method:



4. Test your program works