Zirui Chen 201235448

Dependencies:   mbed

Committer:
ChenZirui
Date:
Fri May 29 07:39:20 2020 +0000
Revision:
16:f8a6834a0289
Parent:
12:b476186651cf
Final submission . I have read and agreed with Statement of Academic Integrity

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ChenZirui 5:7207c9b70108 1 #ifndef BOARD_H
ChenZirui 5:7207c9b70108 2 #define BOARD_H
ChenZirui 7:f61ac963eb07 3 #define LENGTH 84
ChenZirui 5:7207c9b70108 4 #include "mbed.h"
ChenZirui 5:7207c9b70108 5 #include "N5110.h"
ChenZirui 5:7207c9b70108 6 #include "Gamepad.h"
ChenZirui 5:7207c9b70108 7 #include "Bullet.h"
ChenZirui 7:f61ac963eb07 8 /** Board Class
ChenZirui 7:f61ac963eb07 9 @author Chen Zirui, University of Leeds
ChenZirui 7:f61ac963eb07 10 @brief Board data and its functions list
ChenZirui 7:f61ac963eb07 11 @date May 2020
ChenZirui 7:f61ac963eb07 12 */
ChenZirui 5:7207c9b70108 13 class Board
ChenZirui 5:7207c9b70108 14 {
ChenZirui 5:7207c9b70108 15 public:
ChenZirui 12:b476186651cf 16 /**initial the first data of board*/
ChenZirui 12:b476186651cf 17 void init(int x,int y,int length,int width);
ChenZirui 12:b476186651cf 18 /**use screeen function to draw a board*/
ChenZirui 12:b476186651cf 19 void draw(N5110 &lcd);
ChenZirui 12:b476186651cf 20 /**update borad to position to realise the effect of speed*/
ChenZirui 12:b476186651cf 21 void update(Direction d,float mag);
ChenZirui 12:b476186651cf 22 /**score generation function*/
ChenZirui 12:b476186651cf 23 void add_score();
ChenZirui 12:b476186651cf 24 /**score reading function*/
ChenZirui 12:b476186651cf 25 int get_score();
ChenZirui 12:b476186651cf 26 /**position reading function*/
ChenZirui 12:b476186651cf 27 Vector2D get_pos();
ChenZirui 5:7207c9b70108 28
ChenZirui 5:7207c9b70108 29 private:
ChenZirui 7:f61ac963eb07 30 //all parameters about board
ChenZirui 7:f61ac963eb07 31 int _length;
ChenZirui 5:7207c9b70108 32 int _width;
ChenZirui 5:7207c9b70108 33 int _x;
ChenZirui 5:7207c9b70108 34 int _y;
ChenZirui 5:7207c9b70108 35 int _speed;
ChenZirui 5:7207c9b70108 36 int _score;
ChenZirui 7:f61ac963eb07 37
ChenZirui 5:7207c9b70108 38 };
ChenZirui 5:7207c9b70108 39 #endif