Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Board/Board.h@6:b393cfe4e0a7, 2020-05-28 (annotated)
- Committer:
- ChenZirui
- Date:
- Thu May 28 01:11:47 2020 +0000
- Revision:
- 6:b393cfe4e0a7
- Parent:
- 5:7207c9b70108
- Child:
- 7:f61ac963eb07
not final
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ChenZirui | 5:7207c9b70108 | 1 | #ifndef BOARD_H |
ChenZirui | 5:7207c9b70108 | 2 | #define BOARD_H |
ChenZirui | 5:7207c9b70108 | 3 | |
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 | 5:7207c9b70108 | 8 | |
ChenZirui | 5:7207c9b70108 | 9 | class Board |
ChenZirui | 5:7207c9b70108 | 10 | { |
ChenZirui | 5:7207c9b70108 | 11 | public: |
ChenZirui | 5:7207c9b70108 | 12 | |
ChenZirui | 5:7207c9b70108 | 13 | Board(); |
ChenZirui | 6:b393cfe4e0a7 | 14 | ~Board();//constructor and destructor |
ChenZirui | 6:b393cfe4e0a7 | 15 | void init(int x,int y,int height,int width);//initial the first data of board |
ChenZirui | 6:b393cfe4e0a7 | 16 | void draw(N5110 &lcd);//use screeen function to draw a board |
ChenZirui | 6:b393cfe4e0a7 | 17 | void update(Direction d,float mag);//update borad to position to realise the effect of speed |
ChenZirui | 6:b393cfe4e0a7 | 18 | void add_score();//score generation function |
ChenZirui | 5:7207c9b70108 | 19 | int get_score(); |
ChenZirui | 5:7207c9b70108 | 20 | Vector2D get_pos(); |
ChenZirui | 5:7207c9b70108 | 21 | |
ChenZirui | 5:7207c9b70108 | 22 | private: |
ChenZirui | 5:7207c9b70108 | 23 | |
ChenZirui | 5:7207c9b70108 | 24 | int _height; |
ChenZirui | 5:7207c9b70108 | 25 | int _width; |
ChenZirui | 5:7207c9b70108 | 26 | int _x; |
ChenZirui | 5:7207c9b70108 | 27 | int _y; |
ChenZirui | 5:7207c9b70108 | 28 | int _speed; |
ChenZirui | 5:7207c9b70108 | 29 | int _score; |
ChenZirui | 5:7207c9b70108 | 30 | //bullet _bullet; |
ChenZirui | 5:7207c9b70108 | 31 | |
ChenZirui | 5:7207c9b70108 | 32 | }; |
ChenZirui | 5:7207c9b70108 | 33 | #endif |