ZIYI CHEN ml17z4c 201214999
Dependencies: mbed
Game/Game.h@8:52e0506e98b8, 2019-05-06 (annotated)
- Committer:
- ziyi11
- Date:
- Mon May 06 00:06:15 2019 +0000
- Revision:
- 8:52e0506e98b8
- Parent:
- 7:8b6f175fcb0e
- Child:
- 9:a8b2086a46e5
add game.h and game.cpp although it still has some errors
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ziyi11 | 8:52e0506e98b8 | 1 | #include "mbed.h" |
ziyi11 | 8:52e0506e98b8 | 2 | #include "N5110.h" |
ziyi11 | 8:52e0506e98b8 | 3 | #include "Gamepad.h" |
ziyi11 | 8:52e0506e98b8 | 4 | |
ziyi11 | 8:52e0506e98b8 | 5 | |
ziyi11 | 8:52e0506e98b8 | 6 | |
ziyi11 | 8:52e0506e98b8 | 7 | |
ziyi11 | 8:52e0506e98b8 | 8 | class Snake |
ziyi11 | 8:52e0506e98b8 | 9 | { |
ziyi11 | 8:52e0506e98b8 | 10 | public: |
ziyi11 | 8:52e0506e98b8 | 11 | |
ziyi11 | 8:52e0506e98b8 | 12 | |
ziyi11 | 8:52e0506e98b8 | 13 | Snake(); |
ziyi11 | 8:52e0506e98b8 | 14 | ~Snake(); |
ziyi11 | 8:52e0506e98b8 | 15 | void init(int x, int y); |
ziyi11 | 8:52e0506e98b8 | 16 | void update(Direction d); |
ziyi11 | 8:52e0506e98b8 | 17 | int getLength(); |
ziyi11 | 8:52e0506e98b8 | 18 | int getX(int head); |
ziyi11 | 8:52e0506e98b8 | 19 | int getY(int head); |
ziyi11 | 8:52e0506e98b8 | 20 | void grow(); |
ziyi11 | 8:52e0506e98b8 | 21 | |
ziyi11 | 8:52e0506e98b8 | 22 | private: |
ziyi11 | 8:52e0506e98b8 | 23 | |
ziyi11 | 8:52e0506e98b8 | 24 | |
ziyi11 | 8:52e0506e98b8 | 25 | int _x[484]; |
ziyi11 | 8:52e0506e98b8 | 26 | int _y[484]; |
ziyi11 | 8:52e0506e98b8 | 27 | int _length; |
ziyi11 | 8:52e0506e98b8 | 28 | int _speed; |
ziyi11 | 8:52e0506e98b8 | 29 | char _oldDirection; |
ziyi11 | 8:52e0506e98b8 | 30 | |
ziyi11 | 8:52e0506e98b8 | 31 | |
ziyi11 | 8:52e0506e98b8 | 32 | }; |