test 1 doc

Dependencies:   mbed Gamepad2

Committer:
joebarhouch
Date:
Wed May 27 02:00:08 2020 +0000
Revision:
10:9317a62bd4d0
Parent:
9:9830d3a78572
Child:
11:b3024ab59fa5
individual collision was with enemy and platform was too hard, new game system implemented

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