test 1 doc

Dependencies:   mbed Gamepad2

Committer:
joebarhouch
Date:
Tue May 26 01:45:20 2020 +0000
Revision:
7:530ca713d2b2
Parent:
6:00d20886e4f8
Child:
8:d19b30a6cd69
Fully functional game physics with floor collision and jumps

Who changed what in which revision?

UserRevisionLine numberNew contents of line
joebarhouch 3:e4e1cbf750b6 1 #ifndef ENGINE_H
joebarhouch 3:e4e1cbf750b6 2 #define ENGINE_H
joebarhouch 3:e4e1cbf750b6 3
joebarhouch 3:e4e1cbf750b6 4 #include "mbed.h"
joebarhouch 3:e4e1cbf750b6 5 #include "N5110.h"
joebarhouch 3:e4e1cbf750b6 6 #include "Gamepad.h"
joebarhouch 3:e4e1cbf750b6 7 #include "Player.h"
joebarhouch 5:928c2eee4109 8 #include "Platform.h"
joebarhouch 3:e4e1cbf750b6 9
joebarhouch 6:00d20886e4f8 10 void drawMap(N5110 &lcd);
joebarhouch 6:00d20886e4f8 11
joebarhouch 3:e4e1cbf750b6 12 class Engine
joebarhouch 3:e4e1cbf750b6 13 {
joebarhouch 3:e4e1cbf750b6 14
joebarhouch 3:e4e1cbf750b6 15 public:
joebarhouch 3:e4e1cbf750b6 16 Engine();
joebarhouch 3:e4e1cbf750b6 17 ~Engine();
joebarhouch 3:e4e1cbf750b6 18
joebarhouch 3:e4e1cbf750b6 19 void init();
joebarhouch 3:e4e1cbf750b6 20 void read_input(Gamepad &pad);
joebarhouch 3:e4e1cbf750b6 21 void update(Gamepad &pad);
joebarhouch 3:e4e1cbf750b6 22 void draw(N5110 &lcd);
joebarhouch 7:530ca713d2b2 23 void floorCollide();
joebarhouch 7:530ca713d2b2 24
joebarhouch 3:e4e1cbf750b6 25
joebarhouch 7:530ca713d2b2 26 private:
joebarhouch 3:e4e1cbf750b6 27 void ennemyCollide(Gamepad &pad);
joebarhouch 7:530ca713d2b2 28
joebarhouch 6:00d20886e4f8 29 //player object
joebarhouch 3:e4e1cbf750b6 30 Player _p;
joebarhouch 3:e4e1cbf750b6 31 // player coordinates
joebarhouch 3:e4e1cbf750b6 32 int _px;
joebarhouch 3:e4e1cbf750b6 33 int _py;
joebarhouch 7:530ca713d2b2 34
joebarhouch 7:530ca713d2b2 35
joebarhouch 3:e4e1cbf750b6 36 Direction _d;
joebarhouch 3:e4e1cbf750b6 37 float _mag;
joebarhouch 7:530ca713d2b2 38 bool _jump;
joebarhouch 7:530ca713d2b2 39 int _Ypos;
joebarhouch 7:530ca713d2b2 40 bool _fall;
joebarhouch 7:530ca713d2b2 41 bool _collide;
joebarhouch 3:e4e1cbf750b6 42 };
joebarhouch 3:e4e1cbf750b6 43
joebarhouch 3:e4e1cbf750b6 44 #endif