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: Frog/Frog.cpp
- Revision:
- 39:8b09540724b3
- Parent:
- 31:70521f37e004
- Child:
- 40:8cc82e3fce06
--- a/Frog/Frog.cpp Mon May 18 01:21:34 2020 +0000 +++ b/Frog/Frog.cpp Mon May 18 02:05:36 2020 +0000 @@ -1,8 +1,6 @@ #include "Frog.h" -Serial pc(USBTX, USBRX); - -//every chicken object will accept x, y, and width (square) +//every frog object will accept x, y, and width size of grid Frog::Frog(int x, int y, int width){ this->x = x; this->y = y; @@ -14,3 +12,16 @@ down = width + y; } +// reset back to start position +Frog::reset() +{ + x = (84/2)-6/2; + y = 48-4; + width = 6; + + left_side = x; + right_side = width + x; + up = y; + down = width + y; +} +