![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
testing documentation
Dependencies: mbed ll16j23s_test_docs
Food/Food.h@12:33a5cff31339, 2020-05-26 (annotated)
- Committer:
- JoeShotton
- Date:
- Tue May 26 23:57:47 2020 +0000
- Revision:
- 12:33a5cff31339
- Parent:
- 10:a2d643b3c782
documentation test 3
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
JoeShotton | 3:fcd6d70e9694 | 1 | #ifndef FOOD_H |
JoeShotton | 3:fcd6d70e9694 | 2 | #define FOOD_H |
JoeShotton | 3:fcd6d70e9694 | 3 | |
JoeShotton | 3:fcd6d70e9694 | 4 | #include "mbed.h" |
JoeShotton | 3:fcd6d70e9694 | 5 | #include "N5110.h" |
JoeShotton | 3:fcd6d70e9694 | 6 | #include "Gamepad.h" |
JoeShotton | 5:06fa7674622a | 7 | #include "FXOS8700CQ.h" |
JoeShotton | 10:a2d643b3c782 | 8 | |
JoeShotton | 10:a2d643b3c782 | 9 | /** SnakeEngine Class |
JoeShotton | 10:a2d643b3c782 | 10 | @author Joseph Shotton |
JoeShotton | 10:a2d643b3c782 | 11 | @brief All functions that exclusively control the food |
JoeShotton | 10:a2d643b3c782 | 12 | @date May 2020 |
JoeShotton | 10:a2d643b3c782 | 13 | @version V1.0 |
JoeShotton | 10:a2d643b3c782 | 14 | */ |
JoeShotton | 10:a2d643b3c782 | 15 | |
JoeShotton | 3:fcd6d70e9694 | 16 | class Food |
JoeShotton | 3:fcd6d70e9694 | 17 | { |
JoeShotton | 5:06fa7674622a | 18 | |
JoeShotton | 3:fcd6d70e9694 | 19 | public: |
JoeShotton | 3:fcd6d70e9694 | 20 | |
JoeShotton | 3:fcd6d70e9694 | 21 | Food(); |
JoeShotton | 3:fcd6d70e9694 | 22 | ~Food(); |
JoeShotton | 3:fcd6d70e9694 | 23 | |
JoeShotton | 12:33a5cff31339 | 24 | |
JoeShotton | 12:33a5cff31339 | 25 | /** Initialises magnetometer and seeds random function |
JoeShotton | 12:33a5cff31339 | 26 | *@param Gamepad |
JoeShotton | 12:33a5cff31339 | 27 | *@param LCD |
JoeShotton | 12:33a5cff31339 | 28 | *@param Magnetometer |
JoeShotton | 12:33a5cff31339 | 29 | */ |
JoeShotton | 10:a2d643b3c782 | 30 | void init(Gamepad &pad, N5110 &lcd, FXOS8700CQ &mag); |
JoeShotton | 12:33a5cff31339 | 31 | |
JoeShotton | 12:33a5cff31339 | 32 | |
JoeShotton | 12:33a5cff31339 | 33 | /** Chooses random coordinates for food |
JoeShotton | 12:33a5cff31339 | 34 | *@param Gamepad |
JoeShotton | 12:33a5cff31339 | 35 | *@param LCD |
JoeShotton | 12:33a5cff31339 | 36 | *@returns returns true if selected position is already on (ie the snake or walls are at this coordinate) |
JoeShotton | 12:33a5cff31339 | 37 | */ |
JoeShotton | 8:bcc3403d7e79 | 38 | bool rand_pos(Gamepad &pad, N5110 &lcd); |
JoeShotton | 12:33a5cff31339 | 39 | |
JoeShotton | 12:33a5cff31339 | 40 | |
JoeShotton | 12:33a5cff31339 | 41 | /** Animates food |
JoeShotton | 12:33a5cff31339 | 42 | *@param LCD |
JoeShotton | 12:33a5cff31339 | 43 | */ |
JoeShotton | 12:33a5cff31339 | 44 | void draw(N5110 &lcd); |
JoeShotton | 12:33a5cff31339 | 45 | |
JoeShotton | 12:33a5cff31339 | 46 | |
JoeShotton | 12:33a5cff31339 | 47 | /** Runs food functions that need looping |
JoeShotton | 12:33a5cff31339 | 48 | *@param LCD |
JoeShotton | 12:33a5cff31339 | 49 | */ |
JoeShotton | 9:0571880085cc | 50 | void run(N5110 &lcd); |
JoeShotton | 3:fcd6d70e9694 | 51 | |
JoeShotton | 3:fcd6d70e9694 | 52 | int _x; |
JoeShotton | 3:fcd6d70e9694 | 53 | int _y; |
JoeShotton | 4:ea3fa51c4386 | 54 | |
JoeShotton | 4:ea3fa51c4386 | 55 | private: |
JoeShotton | 4:ea3fa51c4386 | 56 | int _frame; |
JoeShotton | 5:06fa7674622a | 57 | float _values; |
JoeShotton | 5:06fa7674622a | 58 | float _seed; |
JoeShotton | 3:fcd6d70e9694 | 59 | }; |
JoeShotton | 3:fcd6d70e9694 | 60 | #endif |