Ahmed Adamjee
/
SnakeVSBlock
Snake vs Block Game to be run upon K64F.
Diff: GameEngine/SnakevsBlock/SnakevsBlock.cpp
- Revision:
- 98:3061aa318fa2
- Parent:
- 95:b068b0735f45
--- a/GameEngine/SnakevsBlock/SnakevsBlock.cpp Thu May 09 09:39:02 2019 +0000 +++ b/GameEngine/SnakevsBlock/SnakevsBlock.cpp Thu May 09 09:59:05 2019 +0000 @@ -304,7 +304,7 @@ //the or for the block's y position is due to the fact the exact y co-ordinate might not be collided if the snake's length has increased in the same itteration. //printf("snake collision working \n"); //audio feedback - srn = CheckBlock(block); //this tells us which of the 5 blocks we are colliding with + srn = CheckCollidingBlock(block); //this tells us which of the 5 blocks we are colliding with blocknum = b_number[srn]; //this saves the number inside the colliding block into blocknum. ImplementSnakeBlockCollision(); //this implements the collision once the conditions are met. SnakevsBlock::_setVelocity(srn); //sets the block and foods free or frezes them depending on snake length. @@ -312,7 +312,7 @@ } } -int SnakevsBlock::CheckBlock(int block) +int SnakevsBlock::CheckCollidingBlock(int block) { //This gets the value of int block from the loop in SnakevsBlock::CheckSnakeBlockCollision() and compares it to some preset ranges, and sees which sr num //should be allocated to it concidering there are 5 blocks numbered 0-4 from right to left, and this identifies the relevant block due to its x axis positions.