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.
Dependencies: mbed
Diff: Cricket/Cricket.cpp
- Revision:
- 23:a16c97a59a41
- Parent:
- 22:69d7fe739872
diff -r 69d7fe739872 -r a16c97a59a41 Cricket/Cricket.cpp --- a/Cricket/Cricket.cpp Tue Apr 30 20:36:42 2019 +0000 +++ b/Cricket/Cricket.cpp Wed May 01 07:40:35 2019 +0000 @@ -64,10 +64,13 @@ void Cricket::game(N5110 &lcd,Gamepad &pad){ if (_new_game==1){ + game_reset(); new_game(lcd,pad); } if (_new_round==1){ + round_reset(); + _new_round=1; new_round(lcd,pad); } else{ @@ -81,19 +84,20 @@ scoreboard.generate_target(); ux.second_menu(lcd); ux.info_screen(lcd,scoreboard.get_target()); + set_field(lcd); + ball.increment_ball_count(); play_game(lcd,pad); } void Cricket::new_round(N5110 &lcd, Gamepad &pad){ if (scoreboard.compare_target()==true){ ux.victory_menu(lcd); - game_reset(); + _new_game=1; } else if(check_ball_count(lcd)==true){ ux.game_over_menu(lcd,1); - game_reset(); + _new_game=1; } else{ - check_ball_count(lcd); pad.leds_off(); round_reset();