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
Fork of el17zl by
PushingEngine/PushingEngine.h@4:750d3f9b54de, 2019-04-09 (annotated)
- Committer:
- franklzw
- Date:
- Tue Apr 09 08:31:27 2019 +0000
- Revision:
- 4:750d3f9b54de
- Parent:
- 2:9f0d9516a6cd
- Child:
- 5:b50ce6160013
fourth commit;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
franklzw | 2:9f0d9516a6cd | 1 | #ifndef PUSHINGENGINE_H |
franklzw | 2:9f0d9516a6cd | 2 | #define PUSHINGENGINE_H |
franklzw | 2:9f0d9516a6cd | 3 | |
franklzw | 2:9f0d9516a6cd | 4 | #include "mbed.h" |
franklzw | 2:9f0d9516a6cd | 5 | #include "N5110.h" |
franklzw | 2:9f0d9516a6cd | 6 | #include "Gamepad.h" |
franklzw | 2:9f0d9516a6cd | 7 | #include "Ppl.h" |
franklzw | 2:9f0d9516a6cd | 8 | #include "Box.h" |
franklzw | 2:9f0d9516a6cd | 9 | |
franklzw | 2:9f0d9516a6cd | 10 | |
franklzw | 2:9f0d9516a6cd | 11 | |
franklzw | 2:9f0d9516a6cd | 12 | class PushingEngine |
franklzw | 2:9f0d9516a6cd | 13 | { |
franklzw | 2:9f0d9516a6cd | 14 | |
franklzw | 2:9f0d9516a6cd | 15 | public: |
franklzw | 2:9f0d9516a6cd | 16 | PushingEngine(); |
franklzw | 2:9f0d9516a6cd | 17 | ~PushingEngine(); |
franklzw | 2:9f0d9516a6cd | 18 | |
franklzw | 4:750d3f9b54de | 19 | void init(int box1_x,int box1_y,int box2_x,int box2_y,int ppl_x,int ppl_y); |
franklzw | 2:9f0d9516a6cd | 20 | void read_input(Gamepad &pad); |
franklzw | 2:9f0d9516a6cd | 21 | void update(Gamepad &pad); |
franklzw | 2:9f0d9516a6cd | 22 | void draw(N5110 &lcd); |
franklzw | 2:9f0d9516a6cd | 23 | |
franklzw | 2:9f0d9516a6cd | 24 | private: |
franklzw | 2:9f0d9516a6cd | 25 | |
franklzw | 4:750d3f9b54de | 26 | void check_ppl_box1_touching(Gamepad &pad); |
franklzw | 4:750d3f9b54de | 27 | void check_ppl_box2_touching(Gamepad &pad); |
franklzw | 2:9f0d9516a6cd | 28 | |
franklzw | 2:9f0d9516a6cd | 29 | Box _b1; |
franklzw | 2:9f0d9516a6cd | 30 | Box _b2; |
franklzw | 2:9f0d9516a6cd | 31 | |
franklzw | 2:9f0d9516a6cd | 32 | // positions of the Boxes |
franklzw | 2:9f0d9516a6cd | 33 | int _b1x; |
franklzw | 2:9f0d9516a6cd | 34 | int _b2x; |
franklzw | 2:9f0d9516a6cd | 35 | int _b1y; |
franklzw | 2:9f0d9516a6cd | 36 | int _b2y; |
franklzw | 2:9f0d9516a6cd | 37 | |
franklzw | 2:9f0d9516a6cd | 38 | Ppl _ppl; |
franklzw | 2:9f0d9516a6cd | 39 | |
franklzw | 2:9f0d9516a6cd | 40 | // poitions of the ppl |
franklzw | 2:9f0d9516a6cd | 41 | int _pplx; |
franklzw | 2:9f0d9516a6cd | 42 | int _pply; |
franklzw | 2:9f0d9516a6cd | 43 | |
franklzw | 2:9f0d9516a6cd | 44 | |
franklzw | 2:9f0d9516a6cd | 45 | }; |
franklzw | 2:9f0d9516a6cd | 46 | |
franklzw | 2:9f0d9516a6cd | 47 | #endif |