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