ELEC2645 (2018/19) / Mbed 2 deprecated el17m2h_public

Dependencies:   mbed

Committer:
el17m2h
Date:
Sat Apr 13 17:37:52 2019 +0000
Revision:
5:8814d6de77d0
Parent:
4:8ec314f806ae
Child:
6:848d1e4c1a31
Created an update function for the doodler to change its position depending on the user moving the joystick left or right.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
el17m2h 2:360a6c301a4e 1 #ifndef ENGINE_H
el17m2h 2:360a6c301a4e 2 #define ENGINE_H
el17m2h 2:360a6c301a4e 3
el17m2h 2:360a6c301a4e 4 #include "mbed.h"
el17m2h 2:360a6c301a4e 5 #include "N5110.h"
el17m2h 2:360a6c301a4e 6 #include "Gamepad.h"
el17m2h 2:360a6c301a4e 7 #include "Floors.h"
el17m2h 4:8ec314f806ae 8 #include "Doodler.h"
el17m2h 2:360a6c301a4e 9
el17m2h 2:360a6c301a4e 10 class Engine{
el17m2h 2:360a6c301a4e 11 public:
el17m2h 2:360a6c301a4e 12 Engine();
el17m2h 2:360a6c301a4e 13 ~Engine();
el17m2h 4:8ec314f806ae 14 void init(int floors_width, int floors_height, int doodler_radius);
el17m2h 5:8814d6de77d0 15 void read_input(Gamepad &pad);
el17m2h 5:8814d6de77d0 16 void update(Gamepad &pad);
el17m2h 2:360a6c301a4e 17 void draw(N5110 &lcd);
el17m2h 2:360a6c301a4e 18
el17m2h 2:360a6c301a4e 19 private:
el17m2h 4:8ec314f806ae 20
el17m2h 2:360a6c301a4e 21 Floors _f1;
el17m2h 2:360a6c301a4e 22 Floors _f2;
el17m2h 2:360a6c301a4e 23 Floors _f3;
el17m2h 2:360a6c301a4e 24 Floors _f4;
el17m2h 2:360a6c301a4e 25 Floors _f5;
el17m2h 2:360a6c301a4e 26 Floors _f6;
el17m2h 2:360a6c301a4e 27 Floors _f7;
el17m2h 2:360a6c301a4e 28 Floors _f8;
el17m2h 2:360a6c301a4e 29 Floors _f9;
el17m2h 2:360a6c301a4e 30 Floors _f10;
el17m2h 2:360a6c301a4e 31
el17m2h 4:8ec314f806ae 32
el17m2h 2:360a6c301a4e 33 int _x;
el17m2h 2:360a6c301a4e 34 int _y;
el17m2h 2:360a6c301a4e 35 int _floors_height;
el17m2h 2:360a6c301a4e 36 int _floors_width;
el17m2h 4:8ec314f806ae 37 int _doodler_radius;
el17m2h 4:8ec314f806ae 38
el17m2h 2:360a6c301a4e 39 // x and y positions of the floors
el17m2h 2:360a6c301a4e 40 int _f1x;
el17m2h 2:360a6c301a4e 41 int _f2x;
el17m2h 2:360a6c301a4e 42 int _f3x;
el17m2h 2:360a6c301a4e 43 int _f4x;
el17m2h 2:360a6c301a4e 44 int _f5x;
el17m2h 2:360a6c301a4e 45 int _f6x;
el17m2h 2:360a6c301a4e 46 int _f7x;
el17m2h 2:360a6c301a4e 47 int _f8x;
el17m2h 2:360a6c301a4e 48 int _f9x;
el17m2h 2:360a6c301a4e 49 int _f10x;
el17m2h 2:360a6c301a4e 50 int _f1y;
el17m2h 2:360a6c301a4e 51 int _f2y;
el17m2h 2:360a6c301a4e 52 int _f3y;
el17m2h 2:360a6c301a4e 53 int _f4y;
el17m2h 2:360a6c301a4e 54 int _f5y;
el17m2h 2:360a6c301a4e 55 int _f6y;
el17m2h 2:360a6c301a4e 56 int _f7y;
el17m2h 2:360a6c301a4e 57 int _f8y;
el17m2h 2:360a6c301a4e 58 int _f9y;
el17m2h 2:360a6c301a4e 59 int _f10y;
el17m2h 2:360a6c301a4e 60
el17m2h 5:8814d6de77d0 61
el17m2h 5:8814d6de77d0 62 Doodler _dood;
el17m2h 5:8814d6de77d0 63
el17m2h 5:8814d6de77d0 64 Direction _d;
el17m2h 5:8814d6de77d0 65 float _mag;
el17m2h 2:360a6c301a4e 66 };
el17m2h 2:360a6c301a4e 67 #endif