summary refs log tree commit diff stats
path: root/src/components/player_physics.h
blob: 26f1fae89841dbf76060c7b3ceda64d3c5370f30 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#ifndef PLAYER_PHYSICS_H
#define PLAYER_PHYSICS_H

#include "entity.h"
#include "physics_body.h"

class Game;

class PlayerPhysicsComponent : public PhysicsBodyComponent {
  public:
    PlayerPhysicsComponent();
    void tick(Game& game, Entity& entity, double dt);
    void receive(Game& game, Entity& entity, const Message& msg);
    
  private:
    double jump_velocity;
    double jump_gravity;
    double jump_gravity_short;
    int direction = 0;
    bool canDrop = false;
    bool frozen = false;
    bool isFalling = false;
};

#endif