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@2:421fb0670c5c, 2018-04-12 (annotated)
- Committer:
- RickYu
- Date:
- Thu Apr 12 22:46:30 2018 +0000
- Revision:
- 2:421fb0670c5c
- Child:
- 3:1a134243e2f0
create the bullet and rect
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 | 2:421fb0670c5c | 12 | void init(int x); |
RickYu | 2:421fb0670c5c | 13 | void draw(N5110 &lcd); |
RickYu | 2:421fb0670c5c | 14 | void update(Direction d,float mag); |
RickYu | 2:421fb0670c5c | 15 | Vector2D get_pos(); |
RickYu | 2:421fb0670c5c | 16 | |
RickYu | 2:421fb0670c5c | 17 | private: |
RickYu | 2:421fb0670c5c | 18 | int rect_x; |
RickYu | 2:421fb0670c5c | 19 | int rect_y; |
RickYu | 2:421fb0670c5c | 20 | int rect_speed; |
RickYu | 2:421fb0670c5c | 21 | |
RickYu | 2:421fb0670c5c | 22 | int bullet_x; |
RickYu | 2:421fb0670c5c | 23 | int bullet_y; |
RickYu | 2:421fb0670c5c | 24 | int bullet_speed; |
RickYu | 2:421fb0670c5c | 25 | |
RickYu | 2:421fb0670c5c | 26 | |
RickYu | 2:421fb0670c5c | 27 | }; |
RickYu | 2:421fb0670c5c | 28 | |
RickYu | 2:421fb0670c5c | 29 | |
RickYu | 2:421fb0670c5c | 30 | #endif |