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:
- 28:d0b0a64a832d
- Parent:
- 26:6427f09cf8d3
- Child:
- 29:f7a2d2a755ec
--- a/Cricket/Cricket.cpp Wed May 01 23:01:44 2019 +0000 +++ b/Cricket/Cricket.cpp Tue May 07 17:50:58 2019 +0000 @@ -164,7 +164,7 @@ if(_direction_set==1 && checkHit==1){ if (fielder_check!=-1){ _check_update=ball.update_ball(field[fielder_check].x,field[fielder_check].y); - printf("Location x %i y %i\n",field[fielder_check].x,field[fielder_check].y); + //printf("Location x %i y %i\n",field[fielder_check].x,field[fielder_check].y); if (loft_check==1){ if (_check_update==1) batsman_out(3,pad,lcd); @@ -183,7 +183,9 @@ } } void Cricket::update_scoreboard(int checkUpdate, int runs,Gamepad &pad){ - if (checkUpdate==1){ + if (checkUpdate==1){ + + //Hitting the ball straight would be an easy way to score runs so i have restricted it to no runs if (_ball_direction==N){ scoreboard.update_score(0); pad.led(3,1.0); @@ -290,8 +292,6 @@ _fielders_count++; } } - - if (d==2){ //NE if (pos==1){ field[i].dir=NE; @@ -312,8 +312,6 @@ _fielders_count++; } } - - if (d==3){ //SW if (pos==1){ field[i].dir=SW;