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
CrossyChicken/CrossyChicken.h@4:aae7f8d4ab78, 2020-05-06 (annotated)
- Committer:
- el19tb
- Date:
- Wed May 06 16:53:18 2020 +0000
- Revision:
- 4:aae7f8d4ab78
- Parent:
- 3:648c9d5001be
- Child:
- 5:6e3afee7eac3
Made the code more structured, added different vehicle types;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
el19tb | 4:aae7f8d4ab78 | 1 | |
el19tb | 2:86cef2afa648 | 2 | #ifndef CROSSYCHICKEN_H |
el19tb | 2:86cef2afa648 | 3 | #define CROSSYCHICKEN_H |
el19tb | 3:648c9d5001be | 4 | |
el19tb | 2:86cef2afa648 | 5 | #include "mbed.h" |
el19tb | 2:86cef2afa648 | 6 | #include "N5110.h" |
el19tb | 2:86cef2afa648 | 7 | #include "Gamepad.h" |
el19tb | 3:648c9d5001be | 8 | #include "Chicken.h" |
el19tb | 3:648c9d5001be | 9 | #include "Car.h" |
el19tb | 4:aae7f8d4ab78 | 10 | #include <vector> |
el19tb | 2:86cef2afa648 | 11 | |
el19tb | 2:86cef2afa648 | 12 | struct Input{ |
el19tb | 2:86cef2afa648 | 13 | //UP, |
el19tb | 2:86cef2afa648 | 14 | //DOWN, |
el19tb | 2:86cef2afa648 | 15 | //LEFT, |
el19tb | 2:86cef2afa648 | 16 | //RIGHT |
el19tb | 2:86cef2afa648 | 17 | }; |
el19tb | 2:86cef2afa648 | 18 | |
el19tb | 2:86cef2afa648 | 19 | class CrossyChicken { |
el19tb | 2:86cef2afa648 | 20 | public: |
el19tb | 2:86cef2afa648 | 21 | void start(); |
el19tb | 2:86cef2afa648 | 22 | void input(); |
el19tb | 2:86cef2afa648 | 23 | void process_input(); |
el19tb | 2:86cef2afa648 | 24 | void clear(); |
el19tb | 2:86cef2afa648 | 25 | |
el19tb | 2:86cef2afa648 | 26 | void game(); |
el19tb | 2:86cef2afa648 | 27 | void refresh(); |
el19tb | 3:648c9d5001be | 28 | |
el19tb | 3:648c9d5001be | 29 | void moveChicken(int xWay, int yWay); |
el19tb | 3:648c9d5001be | 30 | |
el19tb | 3:648c9d5001be | 31 | void moveCar(); |
el19tb | 3:648c9d5001be | 32 | void move(); |
el19tb | 3:648c9d5001be | 33 | |
el19tb | 3:648c9d5001be | 34 | void setup(); |
el19tb | 4:aae7f8d4ab78 | 35 | |
el19tb | 3:648c9d5001be | 36 | private: |
el19tb | 2:86cef2afa648 | 37 | }; |
el19tb | 2:86cef2afa648 | 38 | |
el19tb | 2:86cef2afa648 | 39 | |
el19tb | 2:86cef2afa648 | 40 | #endif |
el19tb | 2:86cef2afa648 | 41 | |
el19tb | 2:86cef2afa648 | 42 | |
el19tb | 2:86cef2afa648 | 43 |