Snake game food library
Food.h@1:8d4639c9d1b0, 2017-05-05 (annotated)
- Committer:
- Nefos
- Date:
- Fri May 05 15:19:10 2017 +0000
- Revision:
- 1:8d4639c9d1b0
- Parent:
- 0:337503f9282c
- Child:
- 2:679ab99f2c0f
Final code
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************************/ |
Nefos | 0:337503f9282c | 11 | struct posXY{ |
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(); |
Nefos | 1:8d4639c9d1b0 | 26 | void draw(N5110 &lcd); |
Nefos | 1:8d4639c9d1b0 | 27 | void respawn(); |
Nefos | 1:8d4639c9d1b0 | 28 | posXY 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 |