Snake game food library
Food.h@2:679ab99f2c0f, 2019-04-26 (annotated)
- Committer:
- 1012754868
- Date:
- Fri Apr 26 04:46:35 2019 +0000
- Revision:
- 2:679ab99f2c0f
- Parent:
- 1:8d4639c9d1b0
Completed the basic function of the game snake, made the game selection interface, and left the highest historical record of the game undone.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Nefos | 0:337503f9282c | 1 | #ifndef FOOD_H |
Nefos | 0:337503f9282c | 2 | #define FOOD_H |
Nefos | 0:337503f9282c | 3 | |
Nefos | 0:337503f9282c | 4 | |
Nefos | 0:337503f9282c | 5 | #include "mbed.h" |
Nefos | 0:337503f9282c | 6 | #include "N5110.h" |
Nefos | 0:337503f9282c | 7 | #include "Gamepad.h" |
Nefos | 0:337503f9282c | 8 | //#include "Snake.h" |
Nefos | 1:8d4639c9d1b0 | 9 | |
Nefos | 1:8d4639c9d1b0 | 10 | /************************Structs************************/ |
1012754868 | 2:679ab99f2c0f | 11 | struct Foodpos{ |
Nefos | 0:337503f9282c | 12 | int x; |
Nefos | 0:337503f9282c | 13 | int y; |
Nefos | 0:337503f9282c | 14 | |
Nefos | 0:337503f9282c | 15 | }; |
Nefos | 1:8d4639c9d1b0 | 16 | /************************Class Def************************/ |
Nefos | 1:8d4639c9d1b0 | 17 | class Food{ |
Nefos | 0:337503f9282c | 18 | |
Nefos | 0:337503f9282c | 19 | |
Nefos | 1:8d4639c9d1b0 | 20 | /************************Public Vars************************/ |
Nefos | 0:337503f9282c | 21 | public: |
Nefos | 0:337503f9282c | 22 | |
Nefos | 1:8d4639c9d1b0 | 23 | Food(); |
Nefos | 1:8d4639c9d1b0 | 24 | ~Food(); |
Nefos | 1:8d4639c9d1b0 | 25 | void init(); |
1012754868 | 2:679ab99f2c0f | 26 | void drawfood(N5110 &lcd); |
1012754868 | 2:679ab99f2c0f | 27 | void createfood(); |
1012754868 | 2:679ab99f2c0f | 28 | Foodpos returnPos(); |
Nefos | 0:337503f9282c | 29 | |
Nefos | 1:8d4639c9d1b0 | 30 | /************************Private Vars************************/ |
Nefos | 0:337503f9282c | 31 | private: |
Nefos | 0:337503f9282c | 32 | |
Nefos | 0:337503f9282c | 33 | |
Nefos | 0:337503f9282c | 34 | }; |
Nefos | 0:337503f9282c | 35 | #endif |