Ahmed Adamjee / Mbed 2 deprecated SnakeVSBlock

Dependencies:   mbed

Revision:
33:249cf423fb18
Parent:
32:3a3bdeffdf62
Child:
36:dfdd619874ae
--- a/SnakeFood/SnakeFood.cpp	Mon Apr 15 13:58:09 2019 +0000
+++ b/SnakeFood/SnakeFood.cpp	Wed Apr 17 07:47:06 2019 +0000
@@ -47,8 +47,8 @@
      if(n == 0){
         _fx = (rand() % 82);  //change the number here so that there is always an unsurity(a little) if the food will come or not(change the limits for this)
         _fy = -2;
-        if(blockbuff==0)  { //this makes sure that the snake food appears seperated from the block
-            _fy = -24;
+        if(blockbuff >= (blockgap - 5))  { //this makes sure that the snake food appears seperated from the block
+            _fy = -15;
         }
         n = n+1;  
         }