Merge branch 'master' of github.com:Allanis/LibD

This commit is contained in:
Rtch90 2012-04-17 18:56:38 +01:00
commit 9bcd6860ed
2 changed files with 9 additions and 1 deletions

View File

@ -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;

View File

@ -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;
}
} }