Reham Faqehi / Mbed 2 deprecated fy15raf

Dependencies:   mbed

Fork of fy15raf by ELEC2645 (2017/18)

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Asteroid.h Source File

Asteroid.h

00001 #ifndef stone_H
00002 #define stone_H
00003 
00004 #include "mbed.h"
00005 #include "N5110.h"
00006 #include "Gamepad.h"
00007 
00008 
00009 /** Asteroid Class
00010 * @brief class create the Asteroids 
00011 * @author Reham Faqehi  
00012 * @date May, 2018  */
00013 
00014 
00015 class Asteroid
00016 {
00017 
00018 public:
00019 
00020     /** Constructor */ 
00021     Asteroid();
00022     
00023     /** Destructor */
00024     ~Asteroid();
00025     
00026     /** Initialise the Asteroid position, and size.
00027     * @param speed value (float).           
00028     */   
00029     void init(float speed);
00030     
00031     /** Draw sprite for the Asteroid shape 
00032     * @param LCD object (N5110)     
00033     */ 
00034     void draw(N5110 &lcd);  
00035     
00036     /** Update the Asteroid position           
00037     */
00038     void update();
00039     
00040     /** Get the Asteroid position
00041     * @return the current position
00042     */ 
00043     Vector2D get_pos();
00044 
00045 private:
00046 
00047     Vector2D _velocity;
00048     Vector2D p;
00049     int _size;
00050     int _x;
00051     int _y1;
00052 };
00053 #endif