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: CopterEngine/CopterEngine.h
- Revision:
- 3:5d860d0d589e
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CopterEngine/CopterEngine.h Tue Apr 09 10:17:24 2019 +0000 @@ -0,0 +1,51 @@ +#ifndef COPTERENGINE_H +#define COPTERENGINE_H + +#include "mbed.h" +#include "N5110.h" +#include "Gamepad.h" +#include "Copter.h" +#include "Wall.h" + +// gap from edge of screen +#define GAP 2 + +class CopterEngine +{ + +public: + CopterEngine(); + ~CopterEngine(); + + void init(int copter_width,int copter_height,int wall_size,int speed); + void read_input(Gamepad &pad); + void update(Gamepad &pad); + void draw(N5110 &lcd); + +private: + + void check_wall_collision(Gamepad &pad); + void check_wall_collisions(Gamepad &pad); + void check_goal(Gamepad &pad); + void print_scores(N5110 &lcd); + + Wall _p1; + + + int _copter_width; + int _copter_height; + int _wall_size; + int _speed; + + // x positions of the paddles + int _p1x; + + + Copter _copter; + + Direction _d; + float _mag; + +}; + +#endif \ No newline at end of file