Snake vs Block Game to be run upon K64F.

Dependencies:   mbed

Revision:
37:ee47699915b8
Parent:
36:dfdd619874ae
Child:
41:4edac50f010d
--- a/Blocks/Blocks.cpp	Thu Apr 18 06:19:33 2019 +0000
+++ b/Blocks/Blocks.cpp	Thu Apr 18 14:03:43 2019 +0000
@@ -283,8 +283,8 @@
 
 int Blocks::draw(N5110 &lcd, int length, int blockgap)
 {   
-    _velocity.x = 0;
-    _velocity.y = 1;
+    velocity.x = 0;
+    velocity.y = 1;
     //Resets SnakeFood position if it reaches the bottom of the screen.
     //Also prevents SnakeFood from going out of the side of the screen.
     if(_bx < 0){
@@ -412,8 +412,8 @@
 
 void Blocks::update(int blocknum, int srn, int send) //send sends the block number only when the y position satisfies a particular requirement
 {                                                    //and srn gives the srn of the block, snake is colliding with.
-    _bx += _velocity.x;
-    _by += _velocity.y;
+    _bx += velocity.x;
+    _by += velocity.y;
         
     if(send) {caseselect[srn] = blocknum;}
 }