diff options
Diffstat (limited to 'src/components/player_physics.h')
| -rw-r--r-- | src/components/player_physics.h | 25 |
1 files changed, 25 insertions, 0 deletions
| diff --git a/src/components/player_physics.h b/src/components/player_physics.h new file mode 100644 index 0000000..26f1fae --- /dev/null +++ b/src/components/player_physics.h | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | #ifndef PLAYER_PHYSICS_H | ||
| 2 | #define PLAYER_PHYSICS_H | ||
| 3 | |||
| 4 | #include "entity.h" | ||
| 5 | #include "physics_body.h" | ||
| 6 | |||
| 7 | class Game; | ||
| 8 | |||
| 9 | class PlayerPhysicsComponent : public PhysicsBodyComponent { | ||
| 10 | public: | ||
| 11 | PlayerPhysicsComponent(); | ||
| 12 | void tick(Game& game, Entity& entity, double dt); | ||
| 13 | void receive(Game& game, Entity& entity, const Message& msg); | ||
| 14 | |||
| 15 | private: | ||
| 16 | double jump_velocity; | ||
| 17 | double jump_gravity; | ||
| 18 | double jump_gravity_short; | ||
| 19 | int direction = 0; | ||
| 20 | bool canDrop = false; | ||
| 21 | bool frozen = false; | ||
| 22 | bool isFalling = false; | ||
| 23 | }; | ||
| 24 | |||
| 25 | #endif | ||
