Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
GraphicEngine/GraphicEngine.h@40:8cc82e3fce06, 2020-05-18 (annotated)
- Committer:
- el19tb
- Date:
- Mon May 18 02:36:44 2020 +0000
- Revision:
- 40:8cc82e3fce06
- Parent:
- 18:6be4c3c94a3d
- Child:
- 42:04e326dcf09b
created a collision function for the frog, and different frog interactions when it is in the water or road, and reset function
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
el19tb | 3:648c9d5001be | 1 | #ifndef GRAPHICENGINE_H |
el19tb | 3:648c9d5001be | 2 | #define GRAPHICENGINE_H |
el19tb | 3:648c9d5001be | 3 | |
el19tb | 3:648c9d5001be | 4 | #include "Car.h" |
el19tb | 3:648c9d5001be | 5 | #include "Chicken.h" |
el19tb | 3:648c9d5001be | 6 | #include "Square.h" |
el19tb | 13:cd6d2f999057 | 7 | #include "Vehicle.h" |
el19tb | 3:648c9d5001be | 8 | |
el19tb | 3:648c9d5001be | 9 | #include "mbed.h" |
el19tb | 3:648c9d5001be | 10 | #include "N5110.h" |
el19tb | 3:648c9d5001be | 11 | #include "Gamepad.h" |
el19tb | 4:aae7f8d4ab78 | 12 | #include <vector> |
el19tb | 3:648c9d5001be | 13 | |
el19tb | 3:648c9d5001be | 14 | class GraphicEngine { |
el19tb | 5:6e3afee7eac3 | 15 | public: |
el19tb | 5:6e3afee7eac3 | 16 | typedef struct { |
el19tb | 5:6e3afee7eac3 | 17 | int x; |
el19tb | 5:6e3afee7eac3 | 18 | int y; |
el19tb | 5:6e3afee7eac3 | 19 | int width; |
el19tb | 5:6e3afee7eac3 | 20 | int height; |
el19tb | 5:6e3afee7eac3 | 21 | |
el19tb | 5:6e3afee7eac3 | 22 | } DrawCar; |
el19tb | 18:6be4c3c94a3d | 23 | |
el19tb | 18:6be4c3c94a3d | 24 | typedef struct |
el19tb | 18:6be4c3c94a3d | 25 | { |
el19tb | 18:6be4c3c94a3d | 26 | int x; |
el19tb | 18:6be4c3c94a3d | 27 | int row; |
el19tb | 18:6be4c3c94a3d | 28 | } DrawRoad; |
el19tb | 3:648c9d5001be | 29 | |
el19tb | 3:648c9d5001be | 30 | public: |
el19tb | 3:648c9d5001be | 31 | |
el19tb | 5:6e3afee7eac3 | 32 | Car *car1; |
el19tb | 5:6e3afee7eac3 | 33 | Chicken *chick; |
el19tb | 5:6e3afee7eac3 | 34 | |
el19tb | 40:8cc82e3fce06 | 35 | GraphicEngine(); |
el19tb | 5:6e3afee7eac3 | 36 | GraphicEngine(Chicken *chicken); |
el19tb | 5:6e3afee7eac3 | 37 | |
el19tb | 5:6e3afee7eac3 | 38 | N5110 lcd; |
el19tb | 5:6e3afee7eac3 | 39 | |
el19tb | 5:6e3afee7eac3 | 40 | //initialize the LCD |
el19tb | 5:6e3afee7eac3 | 41 | void init(); |
el19tb | 5:6e3afee7eac3 | 42 | |
el19tb | 5:6e3afee7eac3 | 43 | //draws the chicken to the LCD screen |
el19tb | 5:6e3afee7eac3 | 44 | void showChicken(); |
el19tb | 3:648c9d5001be | 45 | |
el19tb | 5:6e3afee7eac3 | 46 | //draws an individual car to the screen |
el19tb | 5:6e3afee7eac3 | 47 | void showCar(Car *car); |
el19tb | 5:6e3afee7eac3 | 48 | |
el19tb | 5:6e3afee7eac3 | 49 | void clear(); |
el19tb | 5:6e3afee7eac3 | 50 | |
el19tb | 5:6e3afee7eac3 | 51 | void refresh(); |
el19tb | 8:52794de935b2 | 52 | void print(); |
el19tb | 5:6e3afee7eac3 | 53 | |
el19tb | 5:6e3afee7eac3 | 54 | void contrast(); |
el19tb | 5:6e3afee7eac3 | 55 | |
el19tb | 5:6e3afee7eac3 | 56 | void backLightOn(); |
el19tb | 5:6e3afee7eac3 | 57 | void printTest(); |
el19tb | 40:8cc82e3fce06 | 58 | void printLoser(); |
el19tb | 5:6e3afee7eac3 | 59 | |
el19tb | 5:6e3afee7eac3 | 60 | void showIndividualCar(Car *car); |
el19tb | 5:6e3afee7eac3 | 61 | void displayCar(DrawCar &size); |
el19tb | 3:648c9d5001be | 62 | |
el19tb | 3:648c9d5001be | 63 | |
el19tb | 3:648c9d5001be | 64 | }; |
el19tb | 3:648c9d5001be | 65 | |
el19tb | 3:648c9d5001be | 66 | #endif |
el19tb | 3:648c9d5001be | 67 | |
el19tb | 3:648c9d5001be | 68 |