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: Ball/Ball.cpp
- Revision:
- 17:b2b651acffae
- Parent:
- 15:81a3aaf52647
--- a/Ball/Ball.cpp Wed Apr 24 21:17:22 2019 +0000 +++ b/Ball/Ball.cpp Sat Apr 27 14:09:21 2019 +0000 @@ -17,11 +17,19 @@ _y1=3; _x = 42; _y = 15; + _ball_count=0; set_tone=0; bat.init(3,4); bowled=0; + _ball_count=0; } +void Ball::increment_ball_count(){ + _ball_count++; +} +int Ball::get_ball_count(){ + return _ball_count; +} Vector2D Ball::get_pos() { Vector2D p = {_x,_y};