![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
201199550 Li Boyuan PlaneWar Game on K64f
Dependencies: mbed Gamepad N5110
engine.h@0:36c99c50e688, 2020-05-14 (annotated)
- Committer:
- LBY
- Date:
- Thu May 14 10:14:48 2020 +0000
- Revision:
- 0:36c99c50e688
From:201199550 Li Boyuan; Game name: PlaneWar
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
LBY | 0:36c99c50e688 | 1 | #ifndef ENGINE_H |
LBY | 0:36c99c50e688 | 2 | #define ENGINE_H |
LBY | 0:36c99c50e688 | 3 | |
LBY | 0:36c99c50e688 | 4 | #include "plane.h" |
LBY | 0:36c99c50e688 | 5 | #include "life.h" |
LBY | 0:36c99c50e688 | 6 | #include "Bitmap.h" |
LBY | 0:36c99c50e688 | 7 | #include "N5110.h" |
LBY | 0:36c99c50e688 | 8 | #include "Gamepad.h" |
LBY | 0:36c99c50e688 | 9 | |
LBY | 0:36c99c50e688 | 10 | |
LBY | 0:36c99c50e688 | 11 | struct bomb{ |
LBY | 0:36c99c50e688 | 12 | int x; |
LBY | 0:36c99c50e688 | 13 | int y; |
LBY | 0:36c99c50e688 | 14 | int width; |
LBY | 0:36c99c50e688 | 15 | int height; |
LBY | 0:36c99c50e688 | 16 | int *data; |
LBY | 0:36c99c50e688 | 17 | }; |
LBY | 0:36c99c50e688 | 18 | struct bullet{ |
LBY | 0:36c99c50e688 | 19 | int x; |
LBY | 0:36c99c50e688 | 20 | int y; |
LBY | 0:36c99c50e688 | 21 | }; |
LBY | 0:36c99c50e688 | 22 | |
LBY | 0:36c99c50e688 | 23 | enum events{ |
LBY | 0:36c99c50e688 | 24 | DEAD, |
LBY | 0:36c99c50e688 | 25 | FIRE, |
LBY | 0:36c99c50e688 | 26 | ELMININATE, |
LBY | 0:36c99c50e688 | 27 | NONE, |
LBY | 0:36c99c50e688 | 28 | }; |
LBY | 0:36c99c50e688 | 29 | class engine{ |
LBY | 0:36c99c50e688 | 30 | public: |
LBY | 0:36c99c50e688 | 31 | void init(); |
LBY | 0:36c99c50e688 | 32 | events evet_check(plane &p, bomb &b, Gamepad &pad, bullet &bu); |
LBY | 0:36c99c50e688 | 33 | void fire(int x,int y, bullet &b); |
LBY | 0:36c99c50e688 | 34 | int randombomb(); |
LBY | 0:36c99c50e688 | 35 | }; |
LBY | 0:36c99c50e688 | 36 | #endif |