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.
Dependencies: mbed
rec/rect.h@19:362ad1cd6d4a, 2018-04-28 (annotated)
- Committer:
- RickYu
- Date:
- Sat Apr 28 21:59:45 2018 +0000
- Revision:
- 19:362ad1cd6d4a
- Parent:
- 10:ef01b3076040
- Child:
- 24:14489d259ffb
- Child:
- 27:eab2cf10554e
create a help model to introduce hhow to play
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
RickYu | 2:421fb0670c5c | 1 | #ifndef RECT_H |
RickYu | 2:421fb0670c5c | 2 | #define RECT_H |
RickYu | 2:421fb0670c5c | 3 | |
RickYu | 2:421fb0670c5c | 4 | #include "mbed.h" |
RickYu | 2:421fb0670c5c | 5 | #include "N5110.h" |
RickYu | 2:421fb0670c5c | 6 | #include "Gamepad.h" |
RickYu | 2:421fb0670c5c | 7 | class rect{ |
RickYu | 2:421fb0670c5c | 8 | |
RickYu | 2:421fb0670c5c | 9 | public: |
RickYu | 2:421fb0670c5c | 10 | rect(); |
RickYu | 2:421fb0670c5c | 11 | ~rect(); |
RickYu | 3:1a134243e2f0 | 12 | void init(int x,int y); |
RickYu | 2:421fb0670c5c | 13 | void draw(N5110 &lcd); |
RickYu | 2:421fb0670c5c | 14 | void update(Direction d,float mag); |
RickYu | 10:ef01b3076040 | 15 | void add_score(); |
RickYu | 19:362ad1cd6d4a | 16 | void minus_score(); |
RickYu | 10:ef01b3076040 | 17 | int get_score(); |
RickYu | 10:ef01b3076040 | 18 | |
RickYu | 2:421fb0670c5c | 19 | Vector2D get_pos(); |
RickYu | 5:0a116644cce2 | 20 | void set_pos(Vector2D p); |
RickYu | 2:421fb0670c5c | 21 | |
RickYu | 2:421fb0670c5c | 22 | private: |
RickYu | 2:421fb0670c5c | 23 | int rect_x; |
RickYu | 2:421fb0670c5c | 24 | int rect_y; |
RickYu | 2:421fb0670c5c | 25 | int rect_speed; |
RickYu | 10:ef01b3076040 | 26 | int rect_score; |
RickYu | 3:1a134243e2f0 | 27 | |
RickYu | 2:421fb0670c5c | 28 | }; |
RickYu | 2:421fb0670c5c | 29 | |
RickYu | 2:421fb0670c5c | 30 | |
RickYu | 2:421fb0670c5c | 31 | #endif |