Ahmed Adamjee
/
SnakeVSBlock
Snake vs Block Game to be run upon K64F.
Diff: Blocks/Blocks.cpp
- Revision:
- 25:e827f1a8fadc
- Parent:
- 19:05cc9f801468
- Child:
- 30:461231877c89
--- a/Blocks/Blocks.cpp Wed Apr 10 10:59:15 2019 +0000 +++ b/Blocks/Blocks.cpp Wed Apr 10 14:37:05 2019 +0000 @@ -219,6 +219,7 @@ {1,0,0,0,0,0,0,0,0,0,0,0,0,0,1}, {0,1,1,1,1,1,1,1,1,1,1,1,1,1,0}, }; +/* int Sixteen[11][15] = { {0,1,1,1,1,1,1,1,1,1,1,1,1,1,0}, {1,0,0,0,0,0,0,0,0,0,0,0,0,0,1}, @@ -271,7 +272,7 @@ {1,0,0,0,0,0,0,0,0,0,0,0,0,0,1}, {0,1,1,1,1,1,1,1,1,1,1,1,1,1,0}, }; - +*/ int k = 0; void Blocks::init() @@ -282,10 +283,8 @@ int Blocks::draw(N5110 &lcd, int length, int blocknum, int srn, int blockgap) { - _velocity.x = 0; _velocity.y = 1; - //Resets SnakeFood position if it reaches the bottom of the screen. //Also prevents SnakeFood from going out of the side of the screen. if(_bx < 0){ @@ -386,25 +385,14 @@ case 15: lcd.drawSprite(pos,_by,11,15,(int *)Fifteen); break; - case 16: - lcd.drawSprite(pos,_by,11,15,(int *)Sixteen); - break; - case 17: - lcd.drawSprite(pos,_by,11,15,(int *)Seventeen); - break; - case 18: - lcd.drawSprite(pos,_by,11,15,(int *)Eighteen); - break; - case 19: - lcd.drawSprite(pos,_by,11,15,(int *)Nineteen); - break; default: break; } i++; pos+=16; } - return send; + return send; //this is for the game to decide wether to remember the number on the block for the current itteration. + //we dont need to remember if it has already gone past the screen. }