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@11:9661467412cf, 2020-05-18 (annotated)
- Committer:
- el18jgb
- Date:
- Mon May 18 13:32:55 2020 +0000
- Revision:
- 11:9661467412cf
- Parent:
- 10:6c574b8524df
can't see myself on the code website depite many comitts, trying publish to see if thats why;
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 | 9:2836fc3d9ede | 10 | #include "Spikes.h" |
el18jgb | 4:6f898b000797 | 11 | |
el18jgb | 4:6f898b000797 | 12 | // gap from edge of screen |
el18jgb | 4:6f898b000797 | 13 | #define GAP 2 |
el18jgb | 4:6f898b000797 | 14 | |
el18jgb | 4:6f898b000797 | 15 | class Eng |
el18jgb | 4:6f898b000797 | 16 | { |
el18jgb | 4:6f898b000797 | 17 | |
el18jgb | 4:6f898b000797 | 18 | public: |
el18jgb | 5:c37f4ed2cad3 | 19 | Eng(); |
el18jgb | 4:6f898b000797 | 20 | ~Eng(); |
el18jgb | 4:6f898b000797 | 21 | |
el18jgb | 4:6f898b000797 | 22 | void init(); |
el18jgb | 4:6f898b000797 | 23 | void read_input(Gamepad &pad); |
el18jgb | 8:0b9a824c75fe | 24 | void update(Gamepad &pad, int fire, N5110 &lcd); |
el18jgb | 4:6f898b000797 | 25 | void draw(N5110 &lcd); |
el18jgb | 4:6f898b000797 | 26 | |
el18jgb | 7:04a7826ff7e4 | 27 | void powerup(N5110 &lcd, Gamepad &pad); |
el18jgb | 8:0b9a824c75fe | 28 | void print_score(N5110 &lcd); |
el18jgb | 11:9661467412cf | 29 | void print_strike(N5110 &lcd); |
el18jgb | 7:04a7826ff7e4 | 30 | |
el18jgb | 10:6c574b8524df | 31 | void check_s_hit(Gamepad &pad); |
el18jgb | 9:2836fc3d9ede | 32 | |
el18jgb | 7:04a7826ff7e4 | 33 | void tik(); |
el18jgb | 7:04a7826ff7e4 | 34 | |
el18jgb | 4:6f898b000797 | 35 | private: |
el18jgb | 4:6f898b000797 | 36 | |
el18jgb | 10:6c574b8524df | 37 | void check_hit(Gamepad &pad, N5110 &lcd); |
el18jgb | 5:c37f4ed2cad3 | 38 | //void check_miss(Gamepad &pad); |
el18jgb | 5:c37f4ed2cad3 | 39 | //void print_scores(N5110 &lcd); |
el18jgb | 4:6f898b000797 | 40 | |
el18jgb | 4:6f898b000797 | 41 | Heston _h1; |
el18jgb | 5:c37f4ed2cad3 | 42 | //Heston _h2; |
el18jgb | 5:c37f4ed2cad3 | 43 | //Heston _h3; |
el18jgb | 4:6f898b000797 | 44 | |
el18jgb | 5:c37f4ed2cad3 | 45 | int _hest_width; |
el18jgb | 5:c37f4ed2cad3 | 46 | int _hest_height; |
el18jgb | 5:c37f4ed2cad3 | 47 | //int _ball_size; |
el18jgb | 5:c37f4ed2cad3 | 48 | //int _speed; |
el18jgb | 4:6f898b000797 | 49 | |
el18jgb | 4:6f898b000797 | 50 | // positions |
el18jgb | 4:6f898b000797 | 51 | int _h1x; |
el18jgb | 5:c37f4ed2cad3 | 52 | //int _h2x; |
el18jgb | 5:c37f4ed2cad3 | 53 | //int _h3x; |
el18jgb | 5:c37f4ed2cad3 | 54 | //int _h2y; |
el18jgb | 4:6f898b000797 | 55 | int _h1y; |
el18jgb | 5:c37f4ed2cad3 | 56 | //int _h3y; |
el18jgb | 4:6f898b000797 | 57 | |
el18jgb | 4:6f898b000797 | 58 | Aim _aim; |
el18jgb | 4:6f898b000797 | 59 | |
el18jgb | 7:04a7826ff7e4 | 60 | Pup _pup; |
el18jgb | 7:04a7826ff7e4 | 61 | |
el18jgb | 7:04a7826ff7e4 | 62 | int pupon; |
el18jgb | 7:04a7826ff7e4 | 63 | |
el18jgb | 4:6f898b000797 | 64 | Direction _d; |
el18jgb | 4:6f898b000797 | 65 | float _mag; |
el18jgb | 7:04a7826ff7e4 | 66 | |
el18jgb | 7:04a7826ff7e4 | 67 | int _tok; |
el18jgb | 7:04a7826ff7e4 | 68 | |
el18jgb | 7:04a7826ff7e4 | 69 | bool flag; |
el18jgb | 9:2836fc3d9ede | 70 | bool spike_f; |
el18jgb | 9:2836fc3d9ede | 71 | |
el18jgb | 9:2836fc3d9ede | 72 | Spikes _s1; |
el18jgb | 9:2836fc3d9ede | 73 | Spikes _s2; |
el18jgb | 4:6f898b000797 | 74 | |
el18jgb | 4:6f898b000797 | 75 | }; |
el18jgb | 4:6f898b000797 | 76 | |
el18jgb | 4:6f898b000797 | 77 | #endif |