Ahmed Hedait / Mbed 2 deprecated el16ah

Dependencies:   mbed

Committer:
ahmedhedait
Date:
Tue May 08 12:55:17 2018 +0000
Revision:
22:745b4d352183
Parent:
21:bcc84d5cb068
Child:
24:166d726b0f13
I divided the code now into different classes and it works perfectly.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ahmedhedait 17:68d4b4095d80 1 #ifndef MAZEENGINE_H
ahmedhedait 17:68d4b4095d80 2 #define MAZEENGINE_H
ahmedhedait 17:68d4b4095d80 3
ahmedhedait 17:68d4b4095d80 4 #include "mbed.h"
ahmedhedait 17:68d4b4095d80 5 #include "N5110.h"
ahmedhedait 17:68d4b4095d80 6 #include "Gamepad.h"
ahmedhedait 18:d18b9185fa4f 7 #include "Maze.h"
ahmedhedait 18:d18b9185fa4f 8 #include "Ball.h"
ahmedhedait 17:68d4b4095d80 9
ahmedhedait 17:68d4b4095d80 10 class MazeEngine
ahmedhedait 17:68d4b4095d80 11 {
ahmedhedait 17:68d4b4095d80 12 public:
ahmedhedait 17:68d4b4095d80 13
ahmedhedait 17:68d4b4095d80 14 MazeEngine();
ahmedhedait 17:68d4b4095d80 15 ~MazeEngine();
ahmedhedait 21:bcc84d5cb068 16
ahmedhedait 19:c6ebd1394bda 17 void init();
ahmedhedait 19:c6ebd1394bda 18 void read_input(Gamepad &pad);
ahmedhedait 19:c6ebd1394bda 19 void draw(N5110 &lcd);
ahmedhedait 20:041affa5e242 20 void update(Gamepad &pad);
ahmedhedait 21:bcc84d5cb068 21
ahmedhedait 17:68d4b4095d80 22 private:
ahmedhedait 17:68d4b4095d80 23
ahmedhedait 21:bcc84d5cb068 24 void check_goal(Gamepad &pad);
ahmedhedait 21:bcc84d5cb068 25 void print_win(N5110 &lcd);
ahmedhedait 22:745b4d352183 26 void check_wall_collision(Gamepad &pad);
ahmedhedait 21:bcc84d5cb068 27
ahmedhedait 19:c6ebd1394bda 28 Maze _maze;
ahmedhedait 20:041affa5e242 29 Direction _dir;
ahmedhedait 20:041affa5e242 30 Ball _ball;
ahmedhedait 21:bcc84d5cb068 31 Vector2D ball_pos;
ahmedhedait 22:745b4d352183 32
ahmedhedait 22:745b4d352183 33 int _a;
ahmedhedait 22:745b4d352183 34 int _b;
ahmedhedait 22:745b4d352183 35 int _c;
ahmedhedait 22:745b4d352183 36 int _d;
ahmedhedait 19:c6ebd1394bda 37
ahmedhedait 17:68d4b4095d80 38 };
ahmedhedait 17:68d4b4095d80 39 #endif