summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVittorio Romeo <vittorio.romeo@outlook.com>2021-10-31 18:06:25 +0000
committerVittorio Romeo <vittorio.romeo@outlook.com>2021-10-31 18:06:25 +0000
commita50399b110083be9b67f984c9117ca74a7865bc0 (patch)
treeb4c5a03b6efb83a46d42fbb53f8b1a26e40901e0
parentf97a7359652651c0b325164d0b4d0041818b0266 (diff)
Push player out of wall after death
-rw-r--r--src/SSVOpenHexagon/Components/CPlayer.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/SSVOpenHexagon/Components/CPlayer.cpp b/src/SSVOpenHexagon/Components/CPlayer.cpp
index 0d86b720..d7b3263c 100644
--- a/src/SSVOpenHexagon/Components/CPlayer.cpp
+++ b/src/SSVOpenHexagon/Components/CPlayer.cpp
@@ -42,6 +42,8 @@ CPlayer::CPlayer(const sf::Vector2f& pos, const float swapCooldown,
_dead{false},
_justSwapped{false},
_forcedMove{false},
+ _radius{0.f},
+ _maxSafeDistance{0.f},
_currentSpeed{0.f},
_triangleWidth{unfocusedTriangleWidth},
_triangleWidthTransitionTime{0.f},
@@ -147,6 +149,10 @@ void CPlayer::kill(const bool fatal)
if(fatal)
{
_dead = true;
+
+ // Move back position to graphically show the tip of the triangle
+ // hitting the wall rather than the center of the triangle.
+ _pos = ssvs::getOrbitRad(_lastPos, _angle, -_size);
}
}