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@10:ef01b3076040, 2018-04-22 (annotated)
- Committer:
- RickYu
- Date:
- Sun Apr 22 23:34:39 2018 +0000
- Revision:
- 10:ef01b3076040
- Parent:
- 5:0a116644cce2
- Child:
- 19:362ad1cd6d4a
add score but not work;
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 | 10:ef01b3076040 | 16 | int get_score(); |
RickYu | 10:ef01b3076040 | 17 | |
RickYu | 2:421fb0670c5c | 18 | Vector2D get_pos(); |
RickYu | 5:0a116644cce2 | 19 | void set_pos(Vector2D p); |
RickYu | 2:421fb0670c5c | 20 | |
RickYu | 2:421fb0670c5c | 21 | private: |
RickYu | 2:421fb0670c5c | 22 | int rect_x; |
RickYu | 2:421fb0670c5c | 23 | int rect_y; |
RickYu | 2:421fb0670c5c | 24 | int rect_speed; |
RickYu | 10:ef01b3076040 | 25 | int rect_score; |
RickYu | 3:1a134243e2f0 | 26 | |
RickYu | 2:421fb0670c5c | 27 | }; |
RickYu | 2:421fb0670c5c | 28 | |
RickYu | 2:421fb0670c5c | 29 | |
RickYu | 2:421fb0670c5c | 30 | #endif |