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
Eng.h@4:6f898b000797, 2020-05-14 (annotated)
- Committer:
- el18jgb
- Date:
- Thu May 14 16:16:49 2020 +0000
- Revision:
- 4:6f898b000797
- Child:
- 5:c37f4ed2cad3
not a working commit but want to go to this point if what i try from here fails;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
el18jgb | 4:6f898b000797 | 1 | #ifndef ENG_H |
el18jgb | 4:6f898b000797 | 2 | #define ENG_H |
el18jgb | 4:6f898b000797 | 3 | |
el18jgb | 4:6f898b000797 | 4 | #include "mbed.h" |
el18jgb | 4:6f898b000797 | 5 | #include "N5110.h" |
el18jgb | 4:6f898b000797 | 6 | #include "Gamepad.h" |
el18jgb | 4:6f898b000797 | 7 | #include "Basket.h" |
el18jgb | 4:6f898b000797 | 8 | #include "Heston.h" |
el18jgb | 4:6f898b000797 | 9 | |
el18jgb | 4:6f898b000797 | 10 | // gap from edge of screen |
el18jgb | 4:6f898b000797 | 11 | #define GAP 2 |
el18jgb | 4:6f898b000797 | 12 | |
el18jgb | 4:6f898b000797 | 13 | class Eng |
el18jgb | 4:6f898b000797 | 14 | { |
el18jgb | 4:6f898b000797 | 15 | |
el18jgb | 4:6f898b000797 | 16 | public: |
el18jgb | 4:6f898b000797 | 17 | Eng); |
el18jgb | 4:6f898b000797 | 18 | ~Eng(); |
el18jgb | 4:6f898b000797 | 19 | |
el18jgb | 4:6f898b000797 | 20 | void init(); |
el18jgb | 4:6f898b000797 | 21 | void read_input(Gamepad &pad); |
el18jgb | 4:6f898b000797 | 22 | void update(Gamepad &pad); |
el18jgb | 4:6f898b000797 | 23 | void draw(N5110 &lcd); |
el18jgb | 4:6f898b000797 | 24 | |
el18jgb | 4:6f898b000797 | 25 | private: |
el18jgb | 4:6f898b000797 | 26 | |
el18jgb | 4:6f898b000797 | 27 | void check_hitGamepad &pad); |
el18jgb | 4:6f898b000797 | 28 | void check_miss(Gamepad &pad); |
el18jgb | 4:6f898b000797 | 29 | void print_scores(N5110 &lcd); |
el18jgb | 4:6f898b000797 | 30 | |
el18jgb | 4:6f898b000797 | 31 | Heston _h1; |
el18jgb | 4:6f898b000797 | 32 | Heston _h2; |
el18jgb | 4:6f898b000797 | 33 | Heston _h3; |
el18jgb | 4:6f898b000797 | 34 | |
el18jgb | 4:6f898b000797 | 35 | int _paddle_width; |
el18jgb | 4:6f898b000797 | 36 | int _paddle_height; |
el18jgb | 4:6f898b000797 | 37 | int _ball_size; |
el18jgb | 4:6f898b000797 | 38 | int _speed; |
el18jgb | 4:6f898b000797 | 39 | |
el18jgb | 4:6f898b000797 | 40 | // positions |
el18jgb | 4:6f898b000797 | 41 | int _h1x; |
el18jgb | 4:6f898b000797 | 42 | int _h2x; |
el18jgb | 4:6f898b000797 | 43 | int _h3x; |
el18jgb | 4:6f898b000797 | 44 | int _h2y; |
el18jgb | 4:6f898b000797 | 45 | int _h1y; |
el18jgb | 4:6f898b000797 | 46 | int _h3y; |
el18jgb | 4:6f898b000797 | 47 | |
el18jgb | 4:6f898b000797 | 48 | Aim _aim; |
el18jgb | 4:6f898b000797 | 49 | |
el18jgb | 4:6f898b000797 | 50 | Direction _d; |
el18jgb | 4:6f898b000797 | 51 | float _mag; |
el18jgb | 4:6f898b000797 | 52 | |
el18jgb | 4:6f898b000797 | 53 | }; |
el18jgb | 4:6f898b000797 | 54 | |
el18jgb | 4:6f898b000797 | 55 | #endif |