Ahmed Adamjee
/
SnakeVSBlock
Snake vs Block Game to be run upon K64F.
Diff: Blocks/Blocks.cpp
- Revision:
- 11:d6ceff1ff6d7
- Parent:
- 10:751bd953fa27
- Child:
- 12:1e601b176437
--- a/Blocks/Blocks.cpp Sat Mar 30 17:09:18 2019 +0000 +++ b/Blocks/Blocks.cpp Sat Mar 30 21:42:28 2019 +0000 @@ -295,7 +295,7 @@ if(_bx > 84){ _bx = 84; } - if(_by >= 48){ + if(_by >= 150){ k = 0; } if(k == 0){ @@ -307,7 +307,7 @@ i=0;// to save the positions of the random numbers generated in a block while(pos<=68) { if(times == rand()%6) { - double round = length/2; + double round = length/(3/2); caseselect[i] = floor(round); } else { @@ -320,7 +320,7 @@ } i++; } - double roundagain = length/2; //to make sure at least one is smaller than the snake size + double roundagain = length/(14/4); //to make sure at least one is smaller than the snake size caseselect[rand()%5] = floor(roundagain); }