Ahmed Hedait / Mbed 2 deprecated el16ah

Dependencies:   mbed

Revision:
20:041affa5e242
Parent:
19:c6ebd1394bda
Child:
21:bcc84d5cb068
diff -r c6ebd1394bda -r 041affa5e242 MazeEngine/MazeEngine.cpp
--- a/MazeEngine/MazeEngine.cpp	Tue May 08 11:32:13 2018 +0000
+++ b/MazeEngine/MazeEngine.cpp	Tue May 08 11:57:19 2018 +0000
@@ -12,12 +12,17 @@
 
 void MazeEngine::init()
 {
-
+    _ball.init();
 }
 
 void MazeEngine::read_input(Gamepad &pad)
 {
-    _d = pad.get_direction();
+    _dir = pad.get_direction();
+}
+
+void MazeEngine::update(Gamepad &pad)
+{
+    _ball.update(_dir);
 }
 
 void MazeEngine::draw(N5110 &lcd)
@@ -25,4 +30,7 @@
     // draw the elements in the LCD buffer
     // maze
     _maze.draw(lcd);
+
+    // ball
+    _ball.draw(lcd);
 }
\ No newline at end of file