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