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
Frog/Chicken.cpp@5:6e3afee7eac3, 2020-05-07 (annotated)
- Committer:
- el19tb
- Date:
- Thu May 07 05:35:50 2020 +0000
- Revision:
- 5:6e3afee7eac3
added car direction, and reappearence of cars, made the code more structured
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
el19tb | 5:6e3afee7eac3 | 1 | #include "Chicken.h" |
el19tb | 5:6e3afee7eac3 | 2 | |
el19tb | 5:6e3afee7eac3 | 3 | Serial pc(USBTX, USBRX); |
el19tb | 5:6e3afee7eac3 | 4 | |
el19tb | 5:6e3afee7eac3 | 5 | //every chicken object will accept x, y, and width (square) |
el19tb | 5:6e3afee7eac3 | 6 | Chicken::Chicken(int x, int y, int width){ |
el19tb | 5:6e3afee7eac3 | 7 | this->x = x; |
el19tb | 5:6e3afee7eac3 | 8 | this->y = y; |
el19tb | 5:6e3afee7eac3 | 9 | this->width = width; |
el19tb | 5:6e3afee7eac3 | 10 | |
el19tb | 5:6e3afee7eac3 | 11 | left_side = x; |
el19tb | 5:6e3afee7eac3 | 12 | right_side = width + x; |
el19tb | 5:6e3afee7eac3 | 13 | up = y; |
el19tb | 5:6e3afee7eac3 | 14 | down = width + y; |
el19tb | 5:6e3afee7eac3 | 15 | } |
el19tb | 5:6e3afee7eac3 | 16 |