diff --git a/src/Actor/Actor.cpp b/src/Actor/Actor.cpp index ef7fd02..6abb573 100644 --- a/src/Actor/Actor.cpp +++ b/src/Actor/Actor.cpp @@ -59,8 +59,10 @@ void Actor::Update(float dt) { Move(dt); + float collisionYOffset = GetMaxHeight() / 2.0f; + if(x != oldX || y != oldY) { - if(_level->CheckCollision(x, y, GetAnimation()->GetMaxWidth(), GetAnimation()->GetMaxHeight())) { + if(_level->CheckCollision(x, y + collisionYOffset, GetAnimation()->GetMaxWidth(), GetAnimation()->GetMaxHeight() - collisionYOffset)) { x = oldX; y = oldY; return; diff --git a/src/Actor/Player.cpp b/src/Actor/Player.cpp index 42dfeb2..4df4aaa 100644 --- a/src/Actor/Player.cpp +++ b/src/Actor/Player.cpp @@ -34,4 +34,10 @@ void Player::Move(float dt) { _direction = Actor::FRONT; } + if(KeyDown(SDLK_LSHIFT)) { + _velocity += 3; + } + if(KeyUp(SDLK_LSHIFT)) { + _velocity -= 3; + } }