Snake vs Block Game to be run upon K64F.

Dependencies:   mbed

Revision:
83:329da564799a
Parent:
82:c51ae8a501d1
Child:
94:4e603bd6c381
--- a/GameObjects/Barriers/Barriers.cpp	Mon May 06 10:49:50 2019 +0000
+++ b/GameObjects/Barriers/Barriers.cpp	Mon May 06 14:28:35 2019 +0000
@@ -35,13 +35,16 @@
     {1},
     {1},
 };
-void Barriers::init()
+void Barriers::init(N5110 *lcd)
 {
+    _lcd = lcd;
     reset = 0;
+    _barx = NULL;
+    _bary = NULL;
 }
 
 
-void Barriers::draw(N5110 &lcd, int b_y)
+void Barriers::draw(int b_y)
 {
     velocity.x = 0;
     velocity.y = 1;
@@ -64,7 +67,7 @@
         _bary = -22;
         reset = reset+1; //to stop this if function to keep executing.
     }
-    lcd.drawSprite(_barx,_bary,22,1,(int *)Barrier); //Function to draw the frame at all i coordinates as x.
+    _lcd->drawSprite(_barx,_bary,22,1,(int *)Barrier); //Function to draw the frame at all i coordinates as x.
 
 }