![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Final Submission. I have read and agreed with Statement of Academic Integrity.
Dependencies: mbed Gamepad N5110 Joystick
Snake/Snake.h@4:0fc3441556e1, 2019-05-09 (annotated)
- Committer:
- el16dlc
- Date:
- Thu May 09 07:26:07 2019 +0000
- Revision:
- 4:0fc3441556e1
- Parent:
- 3:660de4311976
- Child:
- 10:aedca0082855
5
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
el16dlc | 1:b9f3b7d869d8 | 1 | #ifndef SNAKE_H |
el16dlc | 1:b9f3b7d869d8 | 2 | #define SNAKE_H |
el16dlc | 1:b9f3b7d869d8 | 3 | |
el16dlc | 1:b9f3b7d869d8 | 4 | #include "mbed.h" |
el16dlc | 1:b9f3b7d869d8 | 5 | #include "N5110.h" |
el16dlc | 1:b9f3b7d869d8 | 6 | #include "Gamepad.h" |
el16dlc | 1:b9f3b7d869d8 | 7 | |
el16dlc | 1:b9f3b7d869d8 | 8 | class Snake { |
el16dlc | 1:b9f3b7d869d8 | 9 | |
el16dlc | 1:b9f3b7d869d8 | 10 | public: |
el16dlc | 1:b9f3b7d869d8 | 11 | // constructor |
el16dlc | 1:b9f3b7d869d8 | 12 | Snake(); |
el16dlc | 1:b9f3b7d869d8 | 13 | |
el16dlc | 1:b9f3b7d869d8 | 14 | // destructor |
el16dlc | 1:b9f3b7d869d8 | 15 | ~Snake(); |
el16dlc | 1:b9f3b7d869d8 | 16 | |
el16dlc | 1:b9f3b7d869d8 | 17 | void init(); |
el16dlc | 1:b9f3b7d869d8 | 18 | void draw_head(N5110 &lcd); |
el16dlc | 2:0bd6711eae26 | 19 | void set_snake_posX(int snake_posX); // mutators |
el16dlc | 2:0bd6711eae26 | 20 | void set_snake_posY(int snake_posY); |
el16dlc | 2:0bd6711eae26 | 21 | int get_snake_posX(); //accessors |
el16dlc | 2:0bd6711eae26 | 22 | int get_snake_posY(); |
el16dlc | 3:660de4311976 | 23 | void draw_food(N5110 &lcd); |
el16dlc | 3:660de4311976 | 24 | void set_food_posX(int food_posX); // mutators |
el16dlc | 3:660de4311976 | 25 | void set_food_posY(int food_posY); |
el16dlc | 3:660de4311976 | 26 | int get_food_posX(); //accessors |
el16dlc | 3:660de4311976 | 27 | int get_food_posY(); |
el16dlc | 1:b9f3b7d869d8 | 28 | |
el16dlc | 1:b9f3b7d869d8 | 29 | private: |
el16dlc | 1:b9f3b7d869d8 | 30 | int _snake_posX; |
el16dlc | 1:b9f3b7d869d8 | 31 | int _snake_posY; |
el16dlc | 3:660de4311976 | 32 | int _food_posX; |
el16dlc | 3:660de4311976 | 33 | int _food_posY; |
el16dlc | 1:b9f3b7d869d8 | 34 | }; |
el16dlc | 1:b9f3b7d869d8 | 35 | #endif |
el16dlc | 1:b9f3b7d869d8 | 36 |