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
Engine/Engine.h@7:0d9cee90ab0d, 2019-04-14 (annotated)
- Committer:
- el17m2h
- Date:
- Sun Apr 14 17:07:02 2019 +0000
- Revision:
- 7:0d9cee90ab0d
- Parent:
- 6:848d1e4c1a31
- Child:
- 8:90e789413e0b
Removed the jump function and instead created a gravity value for the doodler to accelerate downwards at all times.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
el17m2h | 2:360a6c301a4e | 1 | #ifndef ENGINE_H |
el17m2h | 2:360a6c301a4e | 2 | #define ENGINE_H |
el17m2h | 2:360a6c301a4e | 3 | |
el17m2h | 2:360a6c301a4e | 4 | #include "mbed.h" |
el17m2h | 2:360a6c301a4e | 5 | #include "N5110.h" |
el17m2h | 2:360a6c301a4e | 6 | #include "Gamepad.h" |
el17m2h | 2:360a6c301a4e | 7 | #include "Floors.h" |
el17m2h | 4:8ec314f806ae | 8 | #include "Doodler.h" |
el17m2h | 2:360a6c301a4e | 9 | |
el17m2h | 2:360a6c301a4e | 10 | class Engine{ |
el17m2h | 2:360a6c301a4e | 11 | public: |
el17m2h | 2:360a6c301a4e | 12 | Engine(); |
el17m2h | 2:360a6c301a4e | 13 | ~Engine(); |
el17m2h | 4:8ec314f806ae | 14 | void init(int floors_width, int floors_height, int doodler_radius); |
el17m2h | 5:8814d6de77d0 | 15 | void read_input(Gamepad &pad); |
el17m2h | 5:8814d6de77d0 | 16 | void update(Gamepad &pad); |
el17m2h | 2:360a6c301a4e | 17 | void draw(N5110 &lcd); |
el17m2h | 6:848d1e4c1a31 | 18 | void check_floors_collision(Gamepad &pad); |
el17m2h | 4:8ec314f806ae | 19 | |
el17m2h | 7:0d9cee90ab0d | 20 | private: |
el17m2h | 7:0d9cee90ab0d | 21 | Floors _f1; // cambiar a _f[5] (array de pisos) |
el17m2h | 2:360a6c301a4e | 22 | Floors _f2; |
el17m2h | 2:360a6c301a4e | 23 | Floors _f3; |
el17m2h | 2:360a6c301a4e | 24 | Floors _f4; |
el17m2h | 2:360a6c301a4e | 25 | Floors _f5; |
el17m2h | 4:8ec314f806ae | 26 | |
el17m2h | 2:360a6c301a4e | 27 | int _x; |
el17m2h | 2:360a6c301a4e | 28 | int _y; |
el17m2h | 2:360a6c301a4e | 29 | int _floors_height; |
el17m2h | 2:360a6c301a4e | 30 | int _floors_width; |
el17m2h | 4:8ec314f806ae | 31 | |
el17m2h | 2:360a6c301a4e | 32 | // x and y positions of the floors |
el17m2h | 2:360a6c301a4e | 33 | int _f1x; |
el17m2h | 2:360a6c301a4e | 34 | int _f2x; |
el17m2h | 2:360a6c301a4e | 35 | int _f3x; |
el17m2h | 2:360a6c301a4e | 36 | int _f4x; |
el17m2h | 2:360a6c301a4e | 37 | int _f5x; |
el17m2h | 2:360a6c301a4e | 38 | int _f1y; |
el17m2h | 2:360a6c301a4e | 39 | int _f2y; |
el17m2h | 2:360a6c301a4e | 40 | int _f3y; |
el17m2h | 2:360a6c301a4e | 41 | int _f4y; |
el17m2h | 2:360a6c301a4e | 42 | int _f5y; |
el17m2h | 7:0d9cee90ab0d | 43 | |
el17m2h | 2:360a6c301a4e | 44 | |
el17m2h | 7:0d9cee90ab0d | 45 | int _doodler_radius; |
el17m2h | 5:8814d6de77d0 | 46 | |
el17m2h | 5:8814d6de77d0 | 47 | Doodler _dood; |
el17m2h | 5:8814d6de77d0 | 48 | |
el17m2h | 5:8814d6de77d0 | 49 | Direction _d; |
el17m2h | 5:8814d6de77d0 | 50 | float _mag; |
el17m2h | 7:0d9cee90ab0d | 51 | |
el17m2h | 2:360a6c301a4e | 52 | }; |
el17m2h | 2:360a6c301a4e | 53 | #endif |