Merge branch 'master' of github.com:Allanis/LibD
This commit is contained in:
commit
9bcd6860ed
@ -59,8 +59,10 @@ void Actor::Update(float dt) {
|
|||||||
|
|
||||||
Move(dt);
|
Move(dt);
|
||||||
|
|
||||||
|
float collisionYOffset = GetMaxHeight() / 2.0f;
|
||||||
|
|
||||||
if(x != oldX || y != oldY) {
|
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;
|
x = oldX;
|
||||||
y = oldY;
|
y = oldY;
|
||||||
return;
|
return;
|
||||||
|
@ -34,4 +34,10 @@ void Player::Move(float dt) {
|
|||||||
_direction = Actor::FRONT;
|
_direction = Actor::FRONT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(KeyDown(SDLK_LSHIFT)) {
|
||||||
|
_velocity += 3;
|
||||||
|
}
|
||||||
|
if(KeyUp(SDLK_LSHIFT)) {
|
||||||
|
_velocity -= 3;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user