not final
Dependencies: mbed
Diff: Touch/Touch.h
- Revision:
- 5:7207c9b70108
- Child:
- 6:b393cfe4e0a7
diff -r e46c295d4baf -r 7207c9b70108 Touch/Touch.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Touch/Touch.h Wed May 27 21:13:59 2020 +0000 @@ -0,0 +1,51 @@ +#ifndef TOUCH_H +#define TOUCH_H + +#include "mbed.h" +#include "N5110.h" +#include "Gamepad.h" +#include "Bullet.h" +#include "Board.h" + +// gap from edge of screen +#define GAP 2 + +class Touch +{ + +public: + Touch(); + ~Touch(); + + void init(int Board_width,int Board_height,int bullet_size,int speed,N5110 &lcd); + void read_input(Gamepad &pad); + void update(Gamepad &pad,N5110 &lcd); + void draw(N5110 &lcd); + +private: + + void check_wall_collision(Gamepad &pad); + void check_Board_collisions(Gamepad &pad,N5110 &lcd); + void check_goal(Gamepad &pad); + void print_scores(N5110 &lcd); + + Board _p1; + Board _p2; + + int _Board_width; + int _Board_height; + int _bullet_size; + int _speed; + + // x positions of the Boards + int _p1x; + int _p2x; + int _p1y; + Bullet _bullet; + + Direction _d; + float _mag; + +}; + +#endif \ No newline at end of file