
Final Commit
Dependencies: mbed
Food/Food.h@5:27fcb9b36e7e, 2018-03-13 (annotated)
- Committer:
- JRM1986
- Date:
- Tue Mar 13 09:42:49 2018 +0000
- Revision:
- 5:27fcb9b36e7e
- Parent:
- 4:a9634970d33e
- Child:
- 6:f3f508cea1c4
Basic functions and methods done for Food class.; Testing suggests that pixel is not being randomly set, or within range of 48*84 display.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
JRM1986 | 2:ea90cec2489a | 1 | #ifndef FOOD_H |
JRM1986 | 2:ea90cec2489a | 2 | #define FOOD_H |
JRM1986 | 2:ea90cec2489a | 3 | |
JRM1986 | 2:ea90cec2489a | 4 | #include "mbed.h" |
JRM1986 | 3:50f01159c61d | 5 | #include "FXOS8700CQ.h" |
JRM1986 | 3:50f01159c61d | 6 | #include "Gamepad.h" |
JRM1986 | 2:ea90cec2489a | 7 | #include "N5110.h" |
JRM1986 | 2:ea90cec2489a | 8 | |
JRM1986 | 3:50f01159c61d | 9 | struct Position |
JRM1986 | 3:50f01159c61d | 10 | { |
JRM1986 | 3:50f01159c61d | 11 | |
JRM1986 | 3:50f01159c61d | 12 | int x; |
JRM1986 | 3:50f01159c61d | 13 | int y; |
JRM1986 | 3:50f01159c61d | 14 | |
JRM1986 | 3:50f01159c61d | 15 | }; |
JRM1986 | 3:50f01159c61d | 16 | |
JRM1986 | 2:ea90cec2489a | 17 | /** Food Class |
JRM1986 | 1:c3fdbc4b1293 | 18 | * @brief Describes the methods and functions for the food |
JRM1986 | 1:c3fdbc4b1293 | 19 | * @author Joshua R. Marshall |
JRM1986 | 1:c3fdbc4b1293 | 20 | * @date Feb, 2018 |
JRM1986 | 2:ea90cec2489a | 21 | */ |
JRM1986 | 2:ea90cec2489a | 22 | |
JRM1986 | 2:ea90cec2489a | 23 | class Food |
JRM1986 | 2:ea90cec2489a | 24 | { |
JRM1986 | 2:ea90cec2489a | 25 | |
JRM1986 | 2:ea90cec2489a | 26 | public: |
JRM1986 | 2:ea90cec2489a | 27 | Food(); // constructor |
JRM1986 | 2:ea90cec2489a | 28 | ~Food(); // destructor |
JRM1986 | 3:50f01159c61d | 29 | |
JRM1986 | 3:50f01159c61d | 30 | Position get_position(); |
JRM1986 | 4:a9634970d33e | 31 | void set_position(Position p); |
JRM1986 | 5:27fcb9b36e7e | 32 | void draw(N5110 &lcd); |
JRM1986 | 2:ea90cec2489a | 33 | |
JRM1986 | 2:ea90cec2489a | 34 | |
JRM1986 | 2:ea90cec2489a | 35 | private: |
JRM1986 | 2:ea90cec2489a | 36 | |
JRM1986 | 3:50f01159c61d | 37 | int _x; |
JRM1986 | 3:50f01159c61d | 38 | int _y; |
JRM1986 | 2:ea90cec2489a | 39 | |
JRM1986 | 2:ea90cec2489a | 40 | }; |
JRM1986 | 2:ea90cec2489a | 41 | #endif |