Class used to run the maze game loop.

Revision:
1:5a44ce88c5e2
Parent:
0:afee1085c5ef
Child:
2:cbce5d35e7d6
--- a/MazeEngine.h	Fri Apr 07 10:29:16 2017 +0000
+++ b/MazeEngine.h	Mon Apr 17 08:47:00 2017 +0000
@@ -1,15 +1,17 @@
-//
-//  MazeEngine.h
-//
-//
-//  Created by Max Houghton on 19/03/2017.
-//
-//
+/*
+ 
+ @file mazeEngine.h
+ 
+ (c) Max Houghton 19.03.2017
+ Roller Maze Project, ELEC2645, Univeristy of Leeds
+ 
+ */
 
 #ifndef MAZEENGINE_H
 #define MAZEENGINE_H
 
 #include "mbed.h"
+#include "math.h"
 #include "N5110.h"
 #include "Gamepad.h"
 #include "FXOS8700CQ.h"
@@ -24,10 +26,19 @@
     MazeEngine();
     ~MazeEngine();
     
-    void init(int mazeIndex, int x, int y, int radius);
+    void init(int mazeIndex,    // sets the difficulty of the maze
+              int x,            // x coordinate of ball centre
+              int y,            // y coordinate of ball centre
+              int radius,       // radius of the ball
+              bool control,      // option for controlling ball
+              bool colour);     // option for style of ball
+    
     void readInput(Gamepad &pad, FXOS8700CQ &device);
-    void update(Gamepad &pad, N5110 &lcd);
+    void readJoystickInput(Gamepad &pad);
+    void readAccelerometer(FXOS8700CQ &device);
+    void update(N5110 &lcd);
     void draw(N5110 &lcd);
+    void checkWallCollision(N5110 &lcd);
     
 private:
     
@@ -39,9 +50,10 @@
     int _y;
     int _radius;
     
-    Direction _direction;
-    float _magnitude;
+    Vector2D position;
     
+    bool _control;
+    bool _colour;
 };
 
 #endif