ELEC2645 (2019/20) / Mbed 2 deprecated ELEC2645_Project_el19tb

Dependencies:   mbed

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?

UserRevisionLine numberNew 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