AirsoftTimer software based on mbed
Dependencies: mbed TextLCD keypad
Diff: Airsofttimer.cpp
- Revision:
- 9:b587bae22691
- Parent:
- 8:e9fb60f5a56f
- Child:
- 10:afc22465169e
--- a/Airsofttimer.cpp Sat Dec 13 12:48:28 2014 +0000 +++ b/Airsofttimer.cpp Sat Dec 13 13:59:28 2014 +0000 @@ -34,8 +34,28 @@ void Airsofttimer::start(){ while(true){ // first we need to select a game from the available games list - Game* game = Game::create_game(board, 0); + int game_number = select_game(); + Game* game = Game::create_game(board, game_number); game->run(); delete game; } +} + +// show a list of games, and select one +int Airsofttimer::select_game(){ + board->lcd->cls(); + board->lcd->printf(" DummyGame 1 \x02"); + board->lcd->printf(" DummyGame 2 "); + board->lcd->printf(" DummyGame 3 "); + board->lcd->printf(" DummyGame 4 \x03"); + + // draw arrows (refactor this later) + board->lcd->locate(0,0); + board->lcd->putc('\x00'); + board->lcd->locate(0,19); + board->lcd->putc('\x02'); + board->lcd->locate(3,19); + board->lcd->putc('\x03'); + while(true){} // wait until selection is done + return 0; } \ No newline at end of file