Browse Source

FORCE -> MOVE_FORCE

opengl-renderer-broken
Martin Dørum 4 years ago
parent
commit
6347a737b3
2 changed files with 3 additions and 3 deletions
  1. 2
    2
      core.mod/src/entities/EntPlayer.cc
  2. 1
    1
      core.mod/src/entities/EntPlayer.h

+ 2
- 2
core.mod/src/entities/EntPlayer.cc View File

@@ -29,13 +29,13 @@ void EntPlayer::update(const Swan::Context &ctx, float dt) {

// Move left
if (ctx.game.isKeyPressed(SDL_SCANCODE_A) || ctx.game.isKeyPressed(SDL_SCANCODE_LEFT)) {
body_.force_ += Swan::Vec2(-FORCE, 0);
body_.force_ += Swan::Vec2(-MOVE_FORCE, 0);
state_ = State::RUNNING_L;
}

// Move right
if (ctx.game.isKeyPressed(SDL_SCANCODE_D) || ctx.game.isKeyPressed(SDL_SCANCODE_RIGHT)) {
body_.force_ += Swan::Vec2(FORCE, 0);
body_.force_ += Swan::Vec2(MOVE_FORCE, 0);
if (state_ == State::RUNNING_L)
state_ = State::IDLE;
else

+ 1
- 1
core.mod/src/entities/EntPlayer.h View File

@@ -21,7 +21,7 @@ public:

private:
static constexpr float MASS = 80;
static constexpr float FORCE = 34 * MASS;
static constexpr float MOVE_FORCE = 34 * MASS;
static constexpr float JUMP_VEL = 11;
static constexpr float DOWN_FORCE = 20 * MASS;
static constexpr Swan::Vec2 SIZE = Swan::Vec2(0.6, 1.9);

Loading…
Cancel
Save