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@8:0b9a824c75fe, 2020-05-17 (annotated)
- Committer:
- el18jgb
- Date:
- Sun May 17 19:44:26 2020 +0000
- Revision:
- 8:0b9a824c75fe
- Parent:
- 7:04a7826ff7e4
- Child:
- 9:2836fc3d9ede
nothing isnt working, only having problems on accuracy of buttons. goof point to come back to*
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 | 5:c37f4ed2cad3 | 7 | #include "Aim.h" |
el18jgb | 4:6f898b000797 | 8 | #include "Heston.h" |
el18jgb | 7:04a7826ff7e4 | 9 | #include "Pup.h" |
el18jgb | 4:6f898b000797 | 10 | |
el18jgb | 4:6f898b000797 | 11 | // gap from edge of screen |
el18jgb | 4:6f898b000797 | 12 | #define GAP 2 |
el18jgb | 4:6f898b000797 | 13 | |
el18jgb | 4:6f898b000797 | 14 | class Eng |
el18jgb | 4:6f898b000797 | 15 | { |
el18jgb | 4:6f898b000797 | 16 | |
el18jgb | 4:6f898b000797 | 17 | public: |
el18jgb | 5:c37f4ed2cad3 | 18 | Eng(); |
el18jgb | 4:6f898b000797 | 19 | ~Eng(); |
el18jgb | 4:6f898b000797 | 20 | |
el18jgb | 4:6f898b000797 | 21 | void init(); |
el18jgb | 4:6f898b000797 | 22 | void read_input(Gamepad &pad); |
el18jgb | 8:0b9a824c75fe | 23 | void update(Gamepad &pad, int fire, N5110 &lcd); |
el18jgb | 4:6f898b000797 | 24 | void draw(N5110 &lcd); |
el18jgb | 4:6f898b000797 | 25 | |
el18jgb | 7:04a7826ff7e4 | 26 | void powerup(N5110 &lcd, Gamepad &pad); |
el18jgb | 8:0b9a824c75fe | 27 | void print_score(N5110 &lcd); |
el18jgb | 7:04a7826ff7e4 | 28 | |
el18jgb | 7:04a7826ff7e4 | 29 | void tik(); |
el18jgb | 7:04a7826ff7e4 | 30 | |
el18jgb | 4:6f898b000797 | 31 | private: |
el18jgb | 4:6f898b000797 | 32 | |
el18jgb | 5:c37f4ed2cad3 | 33 | void check_hit(Gamepad &pad); |
el18jgb | 5:c37f4ed2cad3 | 34 | //void check_miss(Gamepad &pad); |
el18jgb | 5:c37f4ed2cad3 | 35 | //void print_scores(N5110 &lcd); |
el18jgb | 4:6f898b000797 | 36 | |
el18jgb | 4:6f898b000797 | 37 | Heston _h1; |
el18jgb | 5:c37f4ed2cad3 | 38 | //Heston _h2; |
el18jgb | 5:c37f4ed2cad3 | 39 | //Heston _h3; |
el18jgb | 4:6f898b000797 | 40 | |
el18jgb | 5:c37f4ed2cad3 | 41 | int _hest_width; |
el18jgb | 5:c37f4ed2cad3 | 42 | int _hest_height; |
el18jgb | 5:c37f4ed2cad3 | 43 | //int _ball_size; |
el18jgb | 5:c37f4ed2cad3 | 44 | //int _speed; |
el18jgb | 4:6f898b000797 | 45 | |
el18jgb | 4:6f898b000797 | 46 | // positions |
el18jgb | 4:6f898b000797 | 47 | int _h1x; |
el18jgb | 5:c37f4ed2cad3 | 48 | //int _h2x; |
el18jgb | 5:c37f4ed2cad3 | 49 | //int _h3x; |
el18jgb | 5:c37f4ed2cad3 | 50 | //int _h2y; |
el18jgb | 4:6f898b000797 | 51 | int _h1y; |
el18jgb | 5:c37f4ed2cad3 | 52 | //int _h3y; |
el18jgb | 4:6f898b000797 | 53 | |
el18jgb | 4:6f898b000797 | 54 | Aim _aim; |
el18jgb | 4:6f898b000797 | 55 | |
el18jgb | 7:04a7826ff7e4 | 56 | Pup _pup; |
el18jgb | 7:04a7826ff7e4 | 57 | |
el18jgb | 7:04a7826ff7e4 | 58 | int pupon; |
el18jgb | 7:04a7826ff7e4 | 59 | |
el18jgb | 4:6f898b000797 | 60 | Direction _d; |
el18jgb | 4:6f898b000797 | 61 | float _mag; |
el18jgb | 7:04a7826ff7e4 | 62 | |
el18jgb | 7:04a7826ff7e4 | 63 | int _tok; |
el18jgb | 7:04a7826ff7e4 | 64 | |
el18jgb | 7:04a7826ff7e4 | 65 | bool flag; |
el18jgb | 4:6f898b000797 | 66 | |
el18jgb | 4:6f898b000797 | 67 | }; |
el18jgb | 4:6f898b000797 | 68 | |
el18jgb | 4:6f898b000797 | 69 | #endif |