ELEC2645 (2019/20) / Mbed 2 deprecated ELEC2645_Project_el19tb

Dependencies:   mbed

Committer:
el19tb
Date:
Mon May 18 06:34:53 2020 +0000
Revision:
43:2cd1cfe07770
Parent:
42:04e326dcf09b
Child:
44:f02510eeb165
fixed bugs throughout program, fixed array size issue, fixed functions

Who changed what in which revision?

UserRevisionLine numberNew 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 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 42:04e326dcf09b 14 class GraphicEngine
el19tb 42:04e326dcf09b 15 {
el19tb 5:6e3afee7eac3 16 public:
el19tb 18:6be4c3c94a3d 17 typedef struct
el19tb 18:6be4c3c94a3d 18 {
el19tb 42:04e326dcf09b 19 float x;
el19tb 42:04e326dcf09b 20 int y;
el19tb 42:04e326dcf09b 21 } ObjectParam;
el19tb 42:04e326dcf09b 22
el19tb 3:648c9d5001be 23 public:
el19tb 43:2cd1cfe07770 24 Frog *frog;
el19tb 5:6e3afee7eac3 25
el19tb 40:8cc82e3fce06 26 GraphicEngine();
el19tb 43:2cd1cfe07770 27 GraphicEngine(Frog *frogptr);
el19tb 42:04e326dcf09b 28 public:
el19tb 5:6e3afee7eac3 29
el19tb 5:6e3afee7eac3 30 N5110 lcd;
el19tb 42:04e326dcf09b 31
el19tb 42:04e326dcf09b 32 public:
el19tb 5:6e3afee7eac3 33
el19tb 5:6e3afee7eac3 34 //initialize the LCD
el19tb 42:04e326dcf09b 35 void init();
el19tb 42:04e326dcf09b 36
el19tb 42:04e326dcf09b 37 // clear lcd screen
el19tb 5:6e3afee7eac3 38 void clear();
el19tb 5:6e3afee7eac3 39
el19tb 42:04e326dcf09b 40 // refresh to the next state
el19tb 5:6e3afee7eac3 41 void refresh();
el19tb 5:6e3afee7eac3 42
el19tb 42:04e326dcf09b 43 // set contrast
el19tb 5:6e3afee7eac3 44 void contrast();
el19tb 5:6e3afee7eac3 45
el19tb 42:04e326dcf09b 46 // turn on backlight of lcd
el19tb 5:6e3afee7eac3 47 void backLightOn();
el19tb 42:04e326dcf09b 48
el19tb 42:04e326dcf09b 49
el19tb 5:6e3afee7eac3 50 void printTest();
el19tb 40:8cc82e3fce06 51 void printLoser();
el19tb 42:04e326dcf09b 52 void print();
el19tb 42:04e326dcf09b 53
el19tb 5:6e3afee7eac3 54
el19tb 42:04e326dcf09b 55 void drawGoalPost();
el19tb 3:648c9d5001be 56
el19tb 42:04e326dcf09b 57 //draws the chicken to the LCD screen
el19tb 43:2cd1cfe07770 58 void showFrog(float x, int y, int width, int height);
el19tb 3:648c9d5001be 59
el19tb 43:2cd1cfe07770 60 void drawGoal(int x, int row);
el19tb 43:2cd1cfe07770 61
el19tb 42:04e326dcf09b 62 //draws an individual car to the screen
el19tb 42:04e326dcf09b 63 void showObj(Object &obj);
el19tb 42:04e326dcf09b 64
el19tb 42:04e326dcf09b 65 void displayLog(int x, int y, char c);
el19tb 42:04e326dcf09b 66 void displayVehicle(int x, int y, char c);
el19tb 42:04e326dcf09b 67
el19tb 42:04e326dcf09b 68 void drawSafetyLanes();
el19tb 42:04e326dcf09b 69
el19tb 3:648c9d5001be 70 };
el19tb 3:648c9d5001be 71
el19tb 3:648c9d5001be 72 #endif
el19tb 3:648c9d5001be 73
el19tb 42:04e326dcf09b 74
el19tb 3:648c9d5001be 75