Ben Evans / Mbed 2 deprecated Defender_Game

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Spaceship.h Source File

Spaceship.h

00001 #ifndef SPACESHIP_H
00002 #define SPACESHIP_H
00003  
00004 // Included Headers ------------------------------------------------------------
00005 #include "mbed.h"
00006 #include "CheckCollision.h"
00007 #include "CheckAlienCollision.h"
00008 
00009 /** Spaceship class
00010  * @brief Draws and moves spaceship
00011  * @author Benjamin Evans, University of Leeds
00012  * @date April 2020
00013  */
00014 class Spaceship: public CheckAlienCollision, public CheckCollision {
00015     public:
00016         /** Constructor */
00017         Spaceship();
00018         
00019         /** Destructor */
00020         ~Spaceship();
00021         
00022         /** Initalises Spaceship */
00023         void init();
00024         
00025         /** Draws Spaceship 
00026          * @param lcd @details N5110 object
00027          */
00028         void draw(N5110 &lcd);
00029         
00030         /** Move Spaceship around the screen depedning on joystick input
00031          * @param d_ @details Direction of joystick
00032          */
00033         void movement(Direction d_);   
00034         
00035     // Accessors and mutators --------------------------------------------------
00036         
00037         /** Gets sprtie directon if spaceship 
00038          * @return spaceship_sprite_direction_ @details true = east, 
00039          * false = west
00040          */
00041         bool get_spaceship_sprite_direction(); 
00042         
00043     private:
00044     // Function prototypes -----------------------------------------------------
00045     
00046         /** Sets the x, y position and sprite direction of the spaceship for
00047          * movement function  
00048          * @peram x_change 
00049          * @peram y_change
00050          * @peram sprite_change
00051          * @peram prite_param 
00052          */
00053         void set_spaceship_peram(int x_change,int y_change, bool sprite_change, 
00054         bool sprite_param);
00055         
00056         /** Checks sapceship x and y position and stops spacship comming of the 
00057          * screen in y direction. Keeps spaceship in middle 3rd of screen in 
00058          * x direction 
00059          */
00060         void off_screen_x_y_checker();
00061 };
00062  
00063 #endif