ELEC2645 (2019/20) / Mbed 2 deprecated ELEC2645_Project_el18zc2

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Board.h Source File

Board.h

00001 #ifndef BOARD_H
00002 #define BOARD_H
00003 #define LENGTH 84
00004 #include "mbed.h"
00005 #include "N5110.h"
00006 #include "Gamepad.h"
00007 #include "Bullet.h"
00008 /** Board Class
00009 @author Chen Zirui, University of Leeds
00010 @brief Board data and its functions list
00011 @date  May 2020
00012 */ 
00013 class Board
00014 {
00015 public:
00016     /**initial the first data of board*/
00017     void init(int x,int y,int length,int width);
00018     /**use screeen function to draw a board*/            
00019     void draw(N5110 &lcd);
00020     /**update borad to position to realise the effect of speed*/                                 
00021     void update(Direction d,float mag); 
00022     /**score generation function*/                    
00023     void add_score();
00024     /**score reading function*/                                       
00025     int get_score(); 
00026     /**position reading function*/                                       
00027     Vector2D get_pos();                                     
00028 
00029 private:
00030     //all parameters about board
00031     int _length;
00032     int _width;
00033     int _x;
00034     int _y;
00035     int _speed;
00036     int _score;
00037     
00038 };
00039 #endif