ELEC2645 (2019/20) / Mbed 2 deprecated ELEC2645_Project_el19tb

Dependencies:   mbed

Committer:
el19tb
Date:
Thu May 07 05:35:50 2020 +0000
Revision:
5:6e3afee7eac3
Parent:
4:aae7f8d4ab78
Child:
8:52794de935b2
added car direction, and reappearence of cars, made the code more structured

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 3:648c9d5001be 4 #include "Car.h"
el19tb 3:648c9d5001be 5 #include "Chicken.h"
el19tb 3:648c9d5001be 6 #include "Square.h"
el19tb 3:648c9d5001be 7
el19tb 3:648c9d5001be 8 #include "mbed.h"
el19tb 3:648c9d5001be 9 #include "N5110.h"
el19tb 3:648c9d5001be 10 #include "Gamepad.h"
el19tb 4:aae7f8d4ab78 11 #include <vector>
el19tb 3:648c9d5001be 12
el19tb 3:648c9d5001be 13 class GraphicEngine {
el19tb 5:6e3afee7eac3 14 public:
el19tb 5:6e3afee7eac3 15 typedef struct {
el19tb 5:6e3afee7eac3 16 int x;
el19tb 5:6e3afee7eac3 17 int y;
el19tb 5:6e3afee7eac3 18 int width;
el19tb 5:6e3afee7eac3 19 int height;
el19tb 5:6e3afee7eac3 20
el19tb 5:6e3afee7eac3 21 } DrawCar;
el19tb 3:648c9d5001be 22
el19tb 3:648c9d5001be 23 public:
el19tb 3:648c9d5001be 24
el19tb 5:6e3afee7eac3 25 Car *car1;
el19tb 5:6e3afee7eac3 26 Chicken *chick;
el19tb 5:6e3afee7eac3 27
el19tb 5:6e3afee7eac3 28 GraphicEngine(Chicken *chicken);
el19tb 5:6e3afee7eac3 29
el19tb 5:6e3afee7eac3 30 N5110 lcd;
el19tb 5:6e3afee7eac3 31
el19tb 5:6e3afee7eac3 32 //initialize the LCD
el19tb 5:6e3afee7eac3 33 void init();
el19tb 5:6e3afee7eac3 34
el19tb 5:6e3afee7eac3 35 //draws the chicken to the LCD screen
el19tb 5:6e3afee7eac3 36 void showChicken();
el19tb 3:648c9d5001be 37
el19tb 5:6e3afee7eac3 38 //draws an individual car to the screen
el19tb 5:6e3afee7eac3 39 void showCar(Car *car);
el19tb 5:6e3afee7eac3 40
el19tb 5:6e3afee7eac3 41 void clear();
el19tb 5:6e3afee7eac3 42
el19tb 5:6e3afee7eac3 43 void refresh();
el19tb 5:6e3afee7eac3 44
el19tb 5:6e3afee7eac3 45 void contrast();
el19tb 5:6e3afee7eac3 46
el19tb 5:6e3afee7eac3 47 void backLightOn();
el19tb 5:6e3afee7eac3 48 void printTest();
el19tb 5:6e3afee7eac3 49
el19tb 5:6e3afee7eac3 50 void showIndividualCar(Car *car);
el19tb 5:6e3afee7eac3 51 void displayCar(DrawCar &size);
el19tb 3:648c9d5001be 52
el19tb 3:648c9d5001be 53
el19tb 3:648c9d5001be 54 };
el19tb 3:648c9d5001be 55
el19tb 3:648c9d5001be 56 #endif
el19tb 3:648c9d5001be 57
el19tb 3:648c9d5001be 58