RUOFAN LI / Mbed 2 deprecated el17rl

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 #include "mbed.h"
00005 #include "N5110.h"
00006 #include "Joystick.h"
00007 #include "Bitmap.h"
00008 /* spaceship Class
00009 @Library for Spaceship object in the spaceship project
00010 @coded by Li Ruofan
00011 @May 2020
00012 */
00013 class spaceship{
00014 
00015 public: 
00016      /* Construct function of our ship*/
00017      Spaceship();
00018     
00019      /* Destruct function of our ship*/
00020      ~Spaceship();
00021     
00022     
00023     /* Initiate the position and the size of the ship
00024       @param the value of horizontal position x (int)
00025       @param the value of vertical position y (int)
00026       @param the columns of spaceship image (int)
00027       @param the rows of spaceship image (int) 
00028      */
00029     void init(int x,int y,int width,int height);
00030     
00031     /* draw the image of the ship
00032       @param lcd (N5110)
00033     */
00034     void draw(N5110 &lcd);
00035     
00036     void update();
00037     /// access and mutate
00038     
00039      /* get position and speed of spaceship in the lcd
00040        @return the current postion of spaceship
00041      */        
00042     void set_speed(Vector2D v);
00043     Vector2D get_speed();
00044     Vector2D get_Pos();
00045     
00046 private:
00047     Vector2D _velocity;
00048     int _x;
00049     int _y;
00050     int _width;
00051     int _height;
00052     int _speed;
00053 
00054 };
00055 #endif