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: Engine/Engine.h
- Revision:
- 0:fd8eda608206
- Child:
- 4:fcd80b40f257
diff -r 000000000000 -r fd8eda608206 Engine/Engine.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Engine/Engine.h Wed May 08 18:50:21 2019 +0000 @@ -0,0 +1,57 @@ +#ifndef ENGINE_H +#define ENGINE_H + +#include "mbed.h" +#include "N5110.h" +#include "Gamepad.h" +#include "Stone.h" +#include "Avenger.h" +#include "Wall.h" + +class Engine +{ + +public: + Engine(); + ~Engine(); + void init(int wall_width,int wall_gap,int avenger_size,int stone_size,int speed); + void read_input(Gamepad &pad); + void draw(N5110 &lcd); + void update(Gamepad &pad); + +private: + + void check_wall_collision(Gamepad &pad); + void check_score(Gamepad &pad); + void print_score(N5110 &lcd); + + Wall _w0; + Wall _w1; + Wall _w2; + Wall _w3; + Wall _w4; + + int _wall_width; + int _wall_gap; + int _avenger_size; + int _stone_size; + int _speed; + + // x positions of the paddles + int _w0x; + int _w1x; + int _w2x; + int _w3x; + int _w4x; + int _avengerx; + int _stonex; + + Avenger _avenger; + Stone _stone; + + Direction _d; + float _mag; + +}; + +#endif \ No newline at end of file