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
Parent:
4:aae7f8d4ab78
Child:
8:52794de935b2
added car direction, and reappearence of cars, made the code more structured

Who changed what in which revision?

UserRevisionLine numberNew contents of line
el19tb 4:aae7f8d4ab78 1
el19tb 2:86cef2afa648 2 #ifndef CROSSYCHICKEN_H
el19tb 2:86cef2afa648 3 #define CROSSYCHICKEN_H
el19tb 3:648c9d5001be 4
el19tb 2:86cef2afa648 5 #include "mbed.h"
el19tb 2:86cef2afa648 6 #include "N5110.h"
el19tb 2:86cef2afa648 7 #include "Gamepad.h"
el19tb 3:648c9d5001be 8 #include "Chicken.h"
el19tb 3:648c9d5001be 9 #include "Car.h"
el19tb 4:aae7f8d4ab78 10 #include <vector>
el19tb 2:86cef2afa648 11
el19tb 2:86cef2afa648 12 struct Input{
el19tb 2:86cef2afa648 13 //UP,
el19tb 2:86cef2afa648 14 //DOWN,
el19tb 2:86cef2afa648 15 //LEFT,
el19tb 2:86cef2afa648 16 //RIGHT
el19tb 2:86cef2afa648 17 };
el19tb 2:86cef2afa648 18
el19tb 2:86cef2afa648 19 class CrossyChicken {
el19tb 2:86cef2afa648 20 public:
el19tb 2:86cef2afa648 21 void start();
el19tb 2:86cef2afa648 22 void input();
el19tb 2:86cef2afa648 23 void process_input();
el19tb 2:86cef2afa648 24 void clear();
el19tb 2:86cef2afa648 25
el19tb 2:86cef2afa648 26 void game();
el19tb 2:86cef2afa648 27 void refresh();
el19tb 3:648c9d5001be 28
el19tb 3:648c9d5001be 29 void moveChicken(int xWay, int yWay);
el19tb 3:648c9d5001be 30
el19tb 5:6e3afee7eac3 31 void moveCar(Car *car, int dir, int x);
el19tb 3:648c9d5001be 32 void move();
el19tb 3:648c9d5001be 33
el19tb 3:648c9d5001be 34 void setup();
el19tb 5:6e3afee7eac3 35 void collision(Car* object);
el19tb 5:6e3afee7eac3 36
el19tb 4:aae7f8d4ab78 37
el19tb 3:648c9d5001be 38 private:
el19tb 2:86cef2afa648 39 };
el19tb 2:86cef2afa648 40
el19tb 2:86cef2afa648 41
el19tb 2:86cef2afa648 42 #endif
el19tb 2:86cef2afa648 43
el19tb 2:86cef2afa648 44
el19tb 2:86cef2afa648 45