Ahmed Adamjee
/
SnakeVSBlock
Snake vs Block Game to be run upon K64F.
Diff: GameEngine/SnakevsBlock/SnakevsBlock.cpp
- Revision:
- 95:b068b0735f45
- Parent:
- 93:7f9c31ed5cab
- Child:
- 98:3061aa318fa2
--- a/GameEngine/SnakevsBlock/SnakevsBlock.cpp Wed May 08 23:36:12 2019 +0000 +++ b/GameEngine/SnakevsBlock/SnakevsBlock.cpp Thu May 09 08:35:02 2019 +0000 @@ -31,7 +31,7 @@ //BLOCK DRAW VARIABLES AND INTERFACE PARAMETERS(send_block_number).// _dropbuff = 0; //this makes the food fall at diffrent times when a particular level starts. - send_block_number = 0; //this is 0 when there is no collision, thus block number isn't remembered for next set (which would lead to empty blocks). + send_block_number = false; //this is 0 when there is no collision, thus block number isn't remembered for next set (which would lead to empty blocks). blockgap = 300; //this is the number of itterations the block will reccur after in the first level. //To make default motion of the snake free. @@ -158,7 +158,7 @@ void SnakevsBlock::update() //Updates objects on screen. { - send_block_number = 0; //this is for the game to decide wether to send the number on the block for the current itteration to the blaocks class. + send_block_number = false; //this is for the game to decide wether to send the number on the block for the current itteration to the blaocks class. //we dont need to remember if it has already gone past the screen. The saved number in this changes if the snake collides with the block in CheckSnakeBlockCollision. SnakevsBlock::makeVirtualLengthMaxTen(); //stops the length at 10 for collision and drawing purposes. @@ -353,7 +353,7 @@ void SnakevsBlock::ImplementSnakeBlockCollision() { - send_block_number = 1; + send_block_number = true; if(blocknum > 0) { // to make sure that snake doesn't decrease in _length if number on the block is less than 1; _l.MinusLength(); //instructs the length manager class to subtract the length by 1. _pad->tone(432.0,0.1);