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@42:04e326dcf09b, 2020-05-18 (annotated)
- Committer:
- el19tb
- Date:
- Mon May 18 04:39:06 2020 +0000
- Revision:
- 42:04e326dcf09b
- Parent:
- 40:8cc82e3fce06
- Child:
- 43:2cd1cfe07770
worked on lcd class to display items in a structured way, cleaned up engine a bit
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 | 42:04e326dcf09b | 4 | #include "Frog.h" |
el19tb | 42:04e326dcf09b | 5 | #include "Object.h" |
el19tb | 3:648c9d5001be | 6 | |
el19tb | 3:648c9d5001be | 7 | #include "mbed.h" |
el19tb | 3:648c9d5001be | 8 | #include "N5110.h" |
el19tb | 3:648c9d5001be | 9 | #include "Gamepad.h" |
el19tb | 4:aae7f8d4ab78 | 10 | #include <vector> |
el19tb | 3:648c9d5001be | 11 | |
el19tb | 42:04e326dcf09b | 12 | class GraphicEngine |
el19tb | 42:04e326dcf09b | 13 | { |
el19tb | 5:6e3afee7eac3 | 14 | public: |
el19tb | 18:6be4c3c94a3d | 15 | typedef struct |
el19tb | 18:6be4c3c94a3d | 16 | { |
el19tb | 42:04e326dcf09b | 17 | float x; |
el19tb | 42:04e326dcf09b | 18 | int y; |
el19tb | 42:04e326dcf09b | 19 | } ObjectParam; |
el19tb | 42:04e326dcf09b | 20 | |
el19tb | 3:648c9d5001be | 21 | public: |
el19tb | 5:6e3afee7eac3 | 22 | |
el19tb | 40:8cc82e3fce06 | 23 | GraphicEngine(); |
el19tb | 42:04e326dcf09b | 24 | public: |
el19tb | 5:6e3afee7eac3 | 25 | |
el19tb | 5:6e3afee7eac3 | 26 | N5110 lcd; |
el19tb | 42:04e326dcf09b | 27 | |
el19tb | 42:04e326dcf09b | 28 | public: |
el19tb | 5:6e3afee7eac3 | 29 | |
el19tb | 5:6e3afee7eac3 | 30 | //initialize the LCD |
el19tb | 42:04e326dcf09b | 31 | void init(); |
el19tb | 42:04e326dcf09b | 32 | |
el19tb | 42:04e326dcf09b | 33 | // clear lcd screen |
el19tb | 5:6e3afee7eac3 | 34 | void clear(); |
el19tb | 5:6e3afee7eac3 | 35 | |
el19tb | 42:04e326dcf09b | 36 | // refresh to the next state |
el19tb | 5:6e3afee7eac3 | 37 | void refresh(); |
el19tb | 5:6e3afee7eac3 | 38 | |
el19tb | 42:04e326dcf09b | 39 | // set contrast |
el19tb | 5:6e3afee7eac3 | 40 | void contrast(); |
el19tb | 5:6e3afee7eac3 | 41 | |
el19tb | 42:04e326dcf09b | 42 | // turn on backlight of lcd |
el19tb | 5:6e3afee7eac3 | 43 | void backLightOn(); |
el19tb | 42:04e326dcf09b | 44 | |
el19tb | 42:04e326dcf09b | 45 | |
el19tb | 5:6e3afee7eac3 | 46 | void printTest(); |
el19tb | 40:8cc82e3fce06 | 47 | void printLoser(); |
el19tb | 42:04e326dcf09b | 48 | void print(); |
el19tb | 42:04e326dcf09b | 49 | |
el19tb | 5:6e3afee7eac3 | 50 | |
el19tb | 5:6e3afee7eac3 | 51 | void showIndividualCar(Car *car); |
el19tb | 42:04e326dcf09b | 52 | void displayCar(DrawCar &size); |
el19tb | 42:04e326dcf09b | 53 | void drawGoalPost(); |
el19tb | 3:648c9d5001be | 54 | |
el19tb | 42:04e326dcf09b | 55 | //draws the chicken to the LCD screen |
el19tb | 42:04e326dcf09b | 56 | void showFrog(Frog &frog); |
el19tb | 3:648c9d5001be | 57 | |
el19tb | 42:04e326dcf09b | 58 | //draws an individual car to the screen |
el19tb | 42:04e326dcf09b | 59 | void showObj(Object &obj); |
el19tb | 42:04e326dcf09b | 60 | |
el19tb | 42:04e326dcf09b | 61 | void displayLog(int x, int y, char c); |
el19tb | 42:04e326dcf09b | 62 | void displayVehicle(int x, int y, char c); |
el19tb | 42:04e326dcf09b | 63 | |
el19tb | 42:04e326dcf09b | 64 | void drawSafetyLanes(); |
el19tb | 42:04e326dcf09b | 65 | |
el19tb | 3:648c9d5001be | 66 | }; |
el19tb | 3:648c9d5001be | 67 | |
el19tb | 3:648c9d5001be | 68 | #endif |
el19tb | 3:648c9d5001be | 69 | |
el19tb | 42:04e326dcf09b | 70 | |
el19tb | 3:648c9d5001be | 71 |