Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: Engine/Engine.cpp
- Revision:
- 6:ed553fd191c2
- Parent:
- 5:a3a9e0417e04
- Child:
- 7:c1e0593bfc99
--- a/Engine/Engine.cpp Sun Apr 29 18:03:45 2018 +0000 +++ b/Engine/Engine.cpp Mon Apr 30 15:07:08 2018 +0000 @@ -13,7 +13,7 @@ void Engine::init() // initialise the game parameters { memset(_grid, 0, sizeof(_grid)); - _solid.init(3,5); + _solid.init(10,4); _noodles.init(10,10); } @@ -43,9 +43,14 @@ } } - //lcd.printString("Score",45,44); + lcd.printString("Score",48,0); + - // lcd.printString(convertString(_score),45,38); + int _score = (_solid.getLength() - 3); + + char buffer1[14]; + sprintf(buffer1,"%2d",_score); + lcd.printString(buffer1,48,1); // font is 8 wide, so leave 4 pixel gape from middle assuming two digits } void Engine::update(Gamepad &pad)