ELEC2645 (2019/20) / Mbed 2 deprecated ELEC2645_Project_el19tb

Dependencies:   mbed

Committer:
el19tb
Date:
Sat May 23 03:53:33 2020 +0000
Revision:
47:29c4796a49e5
Parent:
44:f02510eeb165
Child:
49:6cad8b6ec5f2
added frog animation, frog states, and sprites

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 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 42:04e326dcf09b 54
el19tb 42:04e326dcf09b 55 void drawGoalPost();
el19tb 3:648c9d5001be 56
el19tb 42:04e326dcf09b 57 //draws the chicken to the LCD screen
el19tb 47:29c4796a49e5 58 void showFrog(float x, int y, int width, int height, int state);
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 44:f02510eeb165 63 void showObj(Object *obj);
el19tb 44:f02510eeb165 64
el19tb 42:04e326dcf09b 65
el19tb 42:04e326dcf09b 66 void displayLog(int x, int y, char c);
el19tb 42:04e326dcf09b 67 void displayVehicle(int x, int y, char c);
el19tb 42:04e326dcf09b 68
el19tb 42:04e326dcf09b 69 void drawSafetyLanes();
el19tb 42:04e326dcf09b 70
el19tb 3:648c9d5001be 71 };
el19tb 3:648c9d5001be 72
el19tb 3:648c9d5001be 73 #endif
el19tb 3:648c9d5001be 74
el19tb 42:04e326dcf09b 75
el19tb 3:648c9d5001be 76