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/Frog.cpp@55:b17b9931c010, 2020-05-26 (annotated)
- Committer:
- el19tb
- Date:
- Tue May 26 19:54:05 2020 +0000
- Revision:
- 55:b17b9931c010
- Parent:
- 43:2cd1cfe07770
added test files, added testing statements to test schediule, program passed tests
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| el19tb | 31:70521f37e004 | 1 | #include "Frog.h" |
| el19tb | 5:6e3afee7eac3 | 2 | |
| el19tb | 40:8cc82e3fce06 | 3 | //every chicken object will accept x, y, and width (square) |
| el19tb | 31:70521f37e004 | 4 | Frog::Frog(int x, int y, int width){ |
| el19tb | 5:6e3afee7eac3 | 5 | this->x = x; |
| el19tb | 5:6e3afee7eac3 | 6 | this->y = y; |
| el19tb | 5:6e3afee7eac3 | 7 | this->width = width; |
| el19tb | 43:2cd1cfe07770 | 8 | this->height = 4; |
| el19tb | 5:6e3afee7eac3 | 9 | |
| el19tb | 5:6e3afee7eac3 | 10 | left_side = x; |
| el19tb | 5:6e3afee7eac3 | 11 | right_side = width + x; |
| el19tb | 5:6e3afee7eac3 | 12 | up = y; |
| el19tb | 5:6e3afee7eac3 | 13 | down = width + y; |
| el19tb | 5:6e3afee7eac3 | 14 | } |
| el19tb | 5:6e3afee7eac3 | 15 | |
| el19tb | 39:8b09540724b3 | 16 | // reset back to start position |
| el19tb | 40:8cc82e3fce06 | 17 | void Frog::reset() |
| el19tb | 39:8b09540724b3 | 18 | { |
| el19tb | 40:8cc82e3fce06 | 19 | x = (84/2)-4/2; |
| el19tb | 39:8b09540724b3 | 20 | y = 48-4; |
| el19tb | 40:8cc82e3fce06 | 21 | width = 4; |
| el19tb | 39:8b09540724b3 | 22 | |
| el19tb | 39:8b09540724b3 | 23 | left_side = x; |
| el19tb | 39:8b09540724b3 | 24 | right_side = width + x; |
| el19tb | 39:8b09540724b3 | 25 | up = y; |
| el19tb | 39:8b09540724b3 | 26 | down = width + y; |
| el19tb | 55:b17b9931c010 | 27 | |
| el19tb | 55:b17b9931c010 | 28 | //test_frog(); |
| el19tb | 55:b17b9931c010 | 29 | } |
| el19tb | 55:b17b9931c010 | 30 | |
| el19tb | 55:b17b9931c010 | 31 | void Frog::test_frog() |
| el19tb | 55:b17b9931c010 | 32 | { |
| el19tb | 55:b17b9931c010 | 33 | // printf("FROG RECTANGLE PARAMS: %d, %d, %d, %d", this->left_side, |
| el19tb | 55:b17b9931c010 | 34 | // this->right_side, this->up, this->down); |
| el19tb | 39:8b09540724b3 | 35 | } |
| el19tb | 39:8b09540724b3 | 36 | |
| el19tb | 40:8cc82e3fce06 | 37 |