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:
Wed May 27 02:06:05 2020 +0000
Revision:
87:832ca78426b5
Parent:
82:3211b31e9421
Final Submission. I have read and agreed with Statement of Academic Integrity.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
evanso 35:577c65bf914e 1 #ifndef CHECKCOLLISION_H
evanso 35:577c65bf914e 2 #define CHECKCOLLISION_H
evanso 35:577c65bf914e 3
evanso 82:3211b31e9421 4 // Included Headers ------------------------------------------------------------
evanso 35:577c65bf914e 5 #include "mbed.h"
evanso 35:577c65bf914e 6 #include "Position.h"
evanso 35:577c65bf914e 7 #include "Weapons.h"
evanso 35:577c65bf914e 8
evanso 35:577c65bf914e 9 /** CheckCollision class
evanso 35:577c65bf914e 10 * @brief Check Collision perant class
evanso 35:577c65bf914e 11 * @author Benjamin Evans, University of Leeds
evanso 35:577c65bf914e 12 * @date May 2020
evanso 35:577c65bf914e 13 */
evanso 35:577c65bf914e 14 class CheckCollision: virtual public Position{
evanso 35:577c65bf914e 15 public:
evanso 35:577c65bf914e 16 // Function prototypes -----------------------------------------------------
evanso 35:577c65bf914e 17
evanso 35:577c65bf914e 18 /** Checks if bullet collides with a sprite
evanso 35:577c65bf914e 19 * @param bullet @details Weapons object
evanso 35:577c65bf914e 20 */
evanso 35:577c65bf914e 21 bool check_collision(Weapons bullet);
evanso 35:577c65bf914e 22
evanso 35:577c65bf914e 23 protected:
evanso 35:577c65bf914e 24 // Variables ---------------------------------------------------------------
evanso 35:577c65bf914e 25
evanso 35:577c65bf914e 26 /** Length of sprite in x direction */
evanso 35:577c65bf914e 27 int sprite_x_length;
evanso 35:577c65bf914e 28
evanso 35:577c65bf914e 29 /** Length of sprite in y direction */
evanso 35:577c65bf914e 30 int sprite_y_length;
evanso 35:577c65bf914e 31
evanso 35:577c65bf914e 32 };
evanso 35:577c65bf914e 33
evanso 35:577c65bf914e 34 #endif