test 1 doc

Dependencies:   mbed Gamepad2

Committer:
joebarhouch
Date:
Wed May 27 03:52:11 2020 +0000
Revision:
11:b3024ab59fa5
Parent:
10:9317a62bd4d0
Child:
12:eb8d30593e95
Coin class and enemy collision;

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 8:d19b30a6cd69 9 #include "Enemy.h"
joebarhouch 11:b3024ab59fa5 10 #include "Coin.h"
joebarhouch 8:d19b30a6cd69 11 #include <vector>
joebarhouch 3:e4e1cbf750b6 12
joebarhouch 6:00d20886e4f8 13 void drawMap(N5110 &lcd);
joebarhouch 6:00d20886e4f8 14
joebarhouch 3:e4e1cbf750b6 15 class Engine
joebarhouch 3:e4e1cbf750b6 16 {
joebarhouch 3:e4e1cbf750b6 17
joebarhouch 3:e4e1cbf750b6 18 public:
joebarhouch 3:e4e1cbf750b6 19 Engine();
joebarhouch 3:e4e1cbf750b6 20 ~Engine();
joebarhouch 3:e4e1cbf750b6 21
joebarhouch 3:e4e1cbf750b6 22 void init();
joebarhouch 3:e4e1cbf750b6 23 void read_input(Gamepad &pad);
joebarhouch 3:e4e1cbf750b6 24 void update(Gamepad &pad);
joebarhouch 3:e4e1cbf750b6 25 void draw(N5110 &lcd);
joebarhouch 7:530ca713d2b2 26 void floorCollide();
joebarhouch 8:d19b30a6cd69 27 void spawnEnemy();
joebarhouch 11:b3024ab59fa5 28 bool enemyCollide();
joebarhouch 11:b3024ab59fa5 29 void gameOver(N5110 &lcd);
joebarhouch 11:b3024ab59fa5 30 bool ko;
joebarhouch 8:d19b30a6cd69 31
joebarhouch 7:530ca713d2b2 32 private:
joebarhouch 10:9317a62bd4d0 33
joebarhouch 6:00d20886e4f8 34 //player object
joebarhouch 3:e4e1cbf750b6 35 Player _p;
joebarhouch 3:e4e1cbf750b6 36 // player coordinates
joebarhouch 3:e4e1cbf750b6 37 int _px;
joebarhouch 3:e4e1cbf750b6 38 int _py;
joebarhouch 8:d19b30a6cd69 39
joebarhouch 8:d19b30a6cd69 40 Vector2D player;
joebarhouch 8:d19b30a6cd69 41
joebarhouch 8:d19b30a6cd69 42 //gamepad
joebarhouch 3:e4e1cbf750b6 43 Direction _d;
joebarhouch 3:e4e1cbf750b6 44 float _mag;
joebarhouch 8:d19b30a6cd69 45
joebarhouch 8:d19b30a6cd69 46 //physics
joebarhouch 7:530ca713d2b2 47 bool _jump;
joebarhouch 7:530ca713d2b2 48 int _Ypos;
joebarhouch 7:530ca713d2b2 49 bool _fall;
joebarhouch 8:d19b30a6cd69 50 bool _c;
joebarhouch 8:d19b30a6cd69 51
joebarhouch 8:d19b30a6cd69 52 //enemy
joebarhouch 10:9317a62bd4d0 53 vector <Enemy> enemies;
joebarhouch 8:d19b30a6cd69 54
joebarhouch 8:d19b30a6cd69 55
joebarhouch 3:e4e1cbf750b6 56 };
joebarhouch 3:e4e1cbf750b6 57
joebarhouch 3:e4e1cbf750b6 58 #endif