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@52:1145e99264ea, 2020-05-25 (annotated)
- Committer:
- el19tb
- Date:
- Mon May 25 17:53:05 2020 +0000
- Revision:
- 52:1145e99264ea
- Parent:
- 50:9ffeb4a10c0a
- Child:
- 53:b6bb4dab7823
added turtle states, if the frog jumps on turtles under water he is dead...
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 | 43:2cd1cfe07770 | 6 | #include "Vehicle.h" |
el19tb | 43:2cd1cfe07770 | 7 | #include "WaterSprites.h" |
el19tb | 44:f02510eeb165 | 8 | #include "Background.h" |
el19tb | 44:f02510eeb165 | 9 | #include "Frogger.h" |
el19tb | 3:648c9d5001be | 10 | |
el19tb | 3:648c9d5001be | 11 | #include "mbed.h" |
el19tb | 3:648c9d5001be | 12 | #include "N5110.h" |
el19tb | 3:648c9d5001be | 13 | #include "Gamepad.h" |
el19tb | 4:aae7f8d4ab78 | 14 | #include <vector> |
el19tb | 3:648c9d5001be | 15 | |
el19tb | 42:04e326dcf09b | 16 | class GraphicEngine |
el19tb | 42:04e326dcf09b | 17 | { |
el19tb | 5:6e3afee7eac3 | 18 | public: |
el19tb | 18:6be4c3c94a3d | 19 | typedef struct |
el19tb | 18:6be4c3c94a3d | 20 | { |
el19tb | 42:04e326dcf09b | 21 | float x; |
el19tb | 42:04e326dcf09b | 22 | int y; |
el19tb | 42:04e326dcf09b | 23 | } ObjectParam; |
el19tb | 42:04e326dcf09b | 24 | |
el19tb | 3:648c9d5001be | 25 | public: |
el19tb | 44:f02510eeb165 | 26 | //Frog *frog; |
el19tb | 44:f02510eeb165 | 27 | //GraphicEngine(); |
el19tb | 44:f02510eeb165 | 28 | GraphicEngine(); |
el19tb | 5:6e3afee7eac3 | 29 | |
el19tb | 42:04e326dcf09b | 30 | public: |
el19tb | 5:6e3afee7eac3 | 31 | |
el19tb | 5:6e3afee7eac3 | 32 | N5110 lcd; |
el19tb | 42:04e326dcf09b | 33 | |
el19tb | 42:04e326dcf09b | 34 | public: |
el19tb | 5:6e3afee7eac3 | 35 | |
el19tb | 5:6e3afee7eac3 | 36 | //initialize the LCD |
el19tb | 42:04e326dcf09b | 37 | void init(); |
el19tb | 42:04e326dcf09b | 38 | |
el19tb | 42:04e326dcf09b | 39 | // clear lcd screen |
el19tb | 5:6e3afee7eac3 | 40 | void clear(); |
el19tb | 5:6e3afee7eac3 | 41 | |
el19tb | 42:04e326dcf09b | 42 | // refresh to the next state |
el19tb | 5:6e3afee7eac3 | 43 | void refresh(); |
el19tb | 5:6e3afee7eac3 | 44 | |
el19tb | 42:04e326dcf09b | 45 | // set contrast |
el19tb | 5:6e3afee7eac3 | 46 | void contrast(); |
el19tb | 5:6e3afee7eac3 | 47 | |
el19tb | 42:04e326dcf09b | 48 | // turn on backlight of lcd |
el19tb | 5:6e3afee7eac3 | 49 | void backLightOn(); |
el19tb | 42:04e326dcf09b | 50 | |
el19tb | 5:6e3afee7eac3 | 51 | void printTest(); |
el19tb | 40:8cc82e3fce06 | 52 | void printLoser(); |
el19tb | 42:04e326dcf09b | 53 | void print(); |
el19tb | 49:6cad8b6ec5f2 | 54 | void drawDangerZone(); |
el19tb | 42:04e326dcf09b | 55 | |
el19tb | 42:04e326dcf09b | 56 | void drawGoalPost(); |
el19tb | 50:9ffeb4a10c0a | 57 | void drawMenu(); |
el19tb | 50:9ffeb4a10c0a | 58 | void drawPointer(int y); |
el19tb | 50:9ffeb4a10c0a | 59 | void getPointerPos(int sel); |
el19tb | 42:04e326dcf09b | 60 | //draws the chicken to the LCD screen |
el19tb | 47:29c4796a49e5 | 61 | void showFrog(float x, int y, int width, int height, int state); |
el19tb | 3:648c9d5001be | 62 | |
el19tb | 50:9ffeb4a10c0a | 63 | void drawEndPost(int x); |
el19tb | 50:9ffeb4a10c0a | 64 | void printCongrats(); |
el19tb | 43:2cd1cfe07770 | 65 | |
el19tb | 42:04e326dcf09b | 66 | //draws an individual car to the screen |
el19tb | 52:1145e99264ea | 67 | void showObj(Object *obj, int state); |
el19tb | 44:f02510eeb165 | 68 | |
el19tb | 50:9ffeb4a10c0a | 69 | void newLevelIntro(); |
el19tb | 50:9ffeb4a10c0a | 70 | void newLevel1(); |
el19tb | 50:9ffeb4a10c0a | 71 | void newLevel2(); |
el19tb | 50:9ffeb4a10c0a | 72 | void newLevel3(); |
el19tb | 50:9ffeb4a10c0a | 73 | void newLevelGo(); |
el19tb | 52:1145e99264ea | 74 | |
el19tb | 52:1145e99264ea | 75 | void displayTurtles(int x, int y, char c, int turtle_state); |
el19tb | 50:9ffeb4a10c0a | 76 | |
el19tb | 50:9ffeb4a10c0a | 77 | void drawSafetyLanes(); |
el19tb | 42:04e326dcf09b | 78 | void displayLog(int x, int y, char c); |
el19tb | 42:04e326dcf09b | 79 | void displayVehicle(int x, int y, char c); |
el19tb | 42:04e326dcf09b | 80 | |
el19tb | 50:9ffeb4a10c0a | 81 | void drawTutor1(); |
el19tb | 50:9ffeb4a10c0a | 82 | void drawTutor2(); |
el19tb | 50:9ffeb4a10c0a | 83 | void drawTutor3(); |
el19tb | 3:648c9d5001be | 84 | }; |
el19tb | 3:648c9d5001be | 85 | |
el19tb | 3:648c9d5001be | 86 | #endif |
el19tb | 52:1145e99264ea | 87 | |
el19tb | 3:648c9d5001be | 88 |