From 779cc36c57025e49a8e5829347208ff0ef0a9c8f Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Tue, 17 Sep 2013 22:46:00 +0200 Subject: [PATCH] Slightly moved player direction light to not be drawn over player sprite. --- src/Game.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Game.cpp b/src/Game.cpp index d64dc3d..d389efb 100644 --- a/src/Game.cpp +++ b/src/Game.cpp @@ -360,7 +360,10 @@ Game::render() { // Update light mPlayerAreaLight->SetCenter(mPlayer->getPosition().toVec2f()); - mPlayerDirectionLight->SetCenter(mPlayer->getPosition().toVec2f()); + // Avoid light light drawing partially onto player sprite. + Vector2f playerLightPosition = mPlayer->getPosition() + + thor::rotatedVector(Vector2f(0, - 13), mPlayer->getDirection()); + mPlayerDirectionLight->SetCenter(playerLightPosition.toVec2f()); mPlayerDirectionLight->SetDirectionAngle(degreeToRadian(90 - mPlayer->getDirection())); mLightSystem.SetView(mWorldView);