Ahmed Adamjee
/
SnakeVSBlock
Snake vs Block Game to be run upon K64F.
Diff: SnakevsBlock/SnakevsBlock.cpp
- Revision:
- 8:890b986b16a4
- Parent:
- 7:48ba87cd79b5
- Child:
- 9:d1d79d4ee673
--- a/SnakevsBlock/SnakevsBlock.cpp Tue Mar 26 14:45:15 2019 +0000 +++ b/SnakevsBlock/SnakevsBlock.cpp Tue Mar 26 18:36:50 2019 +0000 @@ -13,7 +13,7 @@ void SnakevsBlock::init() { //The snake length configuration and all the other initial information passing will be done here - length=1; + length=15; } @@ -27,7 +27,7 @@ void SnakevsBlock::draw(N5110 &lcd, Gamepad &pad) { - _s.draw(lcd); //Draws the Snake. + _s.draw(lcd, length); //Draws the Snake. //Code to print length on game screen. char bufferscore[14]; @@ -46,7 +46,7 @@ void SnakevsBlock::update(Gamepad &pad) //Updates objects on screen. { - _s.update(_d,_mag); + _s.update(_d,_mag,length); } void SnakevsBlock::get_pos()