Snake vs Block Game to be run upon K64F.

Dependencies:   mbed

Revision:
65:2872ca289b49
Parent:
64:540aa1602372
Child:
70:7caab8069b9b
--- a/GameEngine/SnakevsBlock/SnakevsBlock.h	Thu May 02 11:30:04 2019 +0000
+++ b/GameEngine/SnakevsBlock/SnakevsBlock.h	Fri May 03 19:16:02 2019 +0000
@@ -80,18 +80,6 @@
     */
     void get_pos();
 
-    /** Check Block
-    *
-    *   This function returns the srn of the block we are colliding with;
-    */
-    int CheckBlock(int Block);
-
-    /** Implement Collision
-    *
-    *   This function allows the appropriate maths to take place after every collision.
-    */
-    void ImplementCollision(Gamepad &pad);
-
     //Gamepad @enginePad
 
 private:
@@ -102,6 +90,24 @@
     */
     void CheckSnakeFoodCollision(Gamepad &pad);
 
+    /** Check Snake Food Y Collision
+    *
+    *   This function automatically detects each combination of collision in the y postion.
+    */
+    void CheckSnakeFoodYCollision(Gamepad &pad);
+
+    /** Check Snake Food X Collision
+    *
+    *   This function automatically detects each combination of collision in the x postion.
+    */
+    void CheckSnakeFoodXCollision(Gamepad &pad, int y);
+
+    /** Implement Snake Food Collision
+    *
+    *   This function automatically detects which food we are interacting with and increases the snake length accordingly.
+    */
+    void ImplementSnakeFoodCollision(Gamepad &pad, int x, int y);
+
     /** Check for Snake and Block collision
     *
     *   This function checks if the Snake has come into contact with any Block.
@@ -112,7 +118,19 @@
     *
     *   this is to stop/move the background (food and blocks), when collision occurs at a length greater than 10.lock.
     */
-    void _set_velocity();
+    void _setVelocity(int srn);
+
+    /** Check Block
+    *
+    *   This function returns the srn of the block we are colliding with;
+    */
+    int CheckBlock(int Block);
+
+    /** Implement Collision
+    *
+    *   This function allows the appropriate maths to take place after every collision.
+    */
+    void ImplementSnakeBlockCollision(Gamepad &pad);
 
     /** Check for Snake and Block Sides collision
     *
@@ -130,19 +148,19 @@
     *
     *   This function checks if the Snake and blocks collide anywhere in the Y axis.
     */
-    void check_Collision_Y_axis(int i);
+    void CheckSnakeBlockSidesYCollision(int i);
 
     /** Check Collision in X axis
     *
     *   This function checks if the Snake and blocks collide anywhere in the X axis.
     */
-    void check_Collision_X_axis(int i);
+    void CheckSnakeBlockSidesXCollision(int i);
 
     /** Check Collision East or West
     *
     *  checks if the colliding wall is on east side or west side and then calls StopX_AxisMotion(length,i) to carry out the required task.
     */
-    void checkCollision_EastorWest(int b_x_combination, int i);
+    void CheckSnakeBlockSidesEastWestCollision(int b_x_combination, int i);
 
     /** Make Virtual Length Max Ten
     *
@@ -155,7 +173,7 @@
     *
     *   This function implements the sides collision by making the x axis speed of the particular snake beed 0.
     */
-    void StopX_AxisMotion(int i);
+    void ImplementSnakeBlockSidesCollision(int i);
 
     //OBJECT DECLARATIONS.
     Snake _s;