![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Adam Baker 201166301
Dependencies: mbed Gamepad N5110
Diff: BlockheadEngine/BlockheadEngine.cpp
- Revision:
- 36:6f452777b9ce
- Parent:
- 35:7d69c0822ea9
- Child:
- 38:51ed5820ffe5
--- a/BlockheadEngine/BlockheadEngine.cpp Fri May 03 12:30:08 2019 +0000 +++ b/BlockheadEngine/BlockheadEngine.cpp Sun May 05 14:58:20 2019 +0000 @@ -31,12 +31,24 @@ int BlockheadEngine::playgame(N5110 &lcd, Gamepad &pad) { - + lcd.clear(); + _level = _runner.next_level(); _pos = _lev.whatLevel(lcd, _level); _runner.blockhead(_pos, lcd, pad); _gameover = _runner.gameover_flag(pad); + + lcd.refresh(); return _gameover; } +int BlockheadEngine::highscore() +{ + if (_level >= _highscore) { + _highscore = _level; + } + + return _highscore; +} +