Ben Evans University Second Year Project. Game Called Defender.

Dependencies:   mbed

https://os.mbed.com/media/uploads/evanso/84bc1a30759fd6a1e3f1fd1fae3e97c2.png

Hello, soldier, you have been specially selected as the defender of planet earth.

Your mission, if you choose to accept it. Fly around the planet and pulverise invading alien ships for as long as you can. Stop the aliens abducting the innocent people on the ground. Be warned if an alien ship manages to abduct a person and take them to top of the screen, they will no longer move randomly and will begin to hunt you down. This sounds like a challenge you were trained for.

But don’t worry soldier you’re not going into battle empty-handed. Your ship is equipped with a state of the art laser beam that has unlimited ammo and four smart bombs that will destroy anything on the screen. The ship also has three lives so use them wisely.

As time goes on more alien ships will arrive on planet earth increasing the difficulty of your mission. And remember the landscape bellow loops around so if you continually fly in the same direction you go to your original position. Good luck soldier.

Committer:
evanso
Date:
Tue Apr 14 19:40:33 2020 +0000
Revision:
4:0df2b85e47f1
Parent:
3:dee187b8b30c
Child:
5:acd809cc824c
Added sprite movement using the analogue stick

Who changed what in which revision?

UserRevisionLine numberNew contents of line
evanso 3:dee187b8b30c 1 #ifndef SPACESHIP_H
evanso 3:dee187b8b30c 2 #define SPACESHIP_H
evanso 3:dee187b8b30c 3
evanso 3:dee187b8b30c 4 // Include libraries
evanso 3:dee187b8b30c 5 #include "mbed.h"
evanso 3:dee187b8b30c 6 #include "N5110.h"
evanso 3:dee187b8b30c 7 #include "Gamepad.h"
evanso 3:dee187b8b30c 8
evanso 3:dee187b8b30c 9 /** Spaceship class
evanso 3:dee187b8b30c 10 @brief Draws spaceship
evanso 3:dee187b8b30c 11 @author Benjamin Evans, University of Leeds
evanso 3:dee187b8b30c 12 @date April 2020
evanso 3:dee187b8b30c 13 */
evanso 3:dee187b8b30c 14
evanso 3:dee187b8b30c 15 class Spaceship {
evanso 3:dee187b8b30c 16 public:
evanso 3:dee187b8b30c 17 /** Constructor */
evanso 3:dee187b8b30c 18 Spaceship();
evanso 3:dee187b8b30c 19
evanso 3:dee187b8b30c 20 /** Destructor */
evanso 3:dee187b8b30c 21 ~Spaceship();
evanso 3:dee187b8b30c 22
evanso 3:dee187b8b30c 23 /** Initalises Spaceship */
evanso 3:dee187b8b30c 24 void init();
evanso 3:dee187b8b30c 25
evanso 3:dee187b8b30c 26 /** Draws Spaceship
evanso 3:dee187b8b30c 27 * @param LCD object
evanso 3:dee187b8b30c 28 */
evanso 3:dee187b8b30c 29 void draw(N5110 &lcd);
evanso 3:dee187b8b30c 30
evanso 4:0df2b85e47f1 31 /** Clears Spaceship from LCD
evanso 4:0df2b85e47f1 32 * @param LCD object
evanso 4:0df2b85e47f1 33 */
evanso 4:0df2b85e47f1 34 void clear_spaceship(N5110 &lcd);
evanso 4:0df2b85e47f1 35
evanso 4:0df2b85e47f1 36 /** Move Spaceship either up,down,left,right
evanso 4:0df2b85e47f1 37 * @param Gampad object
evanso 4:0df2b85e47f1 38 */
evanso 4:0df2b85e47f1 39 void movement(Gamepad &pad);
evanso 4:0df2b85e47f1 40
evanso 3:dee187b8b30c 41 private:
evanso 4:0df2b85e47f1 42 int position_x_spaceship_;
evanso 4:0df2b85e47f1 43 int position_y_spaceship_;
evanso 4:0df2b85e47f1 44
evanso 3:dee187b8b30c 45 };
evanso 3:dee187b8b30c 46
evanso 3:dee187b8b30c 47 #endif