refac: rendering, debug overlay, & game mechanics

This commit is contained in:
Florian Sylvain
2025-05-14 00:26:21 +02:00
parent e25d32f8c6
commit 60c33a7965
8 changed files with 77 additions and 85 deletions
+9 -9
View File
@@ -69,15 +69,15 @@ void Ball::updateColor() {
constexpr float TRANSITION_SPEED = 0.05f;
sf::Color newColor;
newColor.r = static_cast<std::uint8_t>(static_cast<float>(currentColor.r) +
TRANSITION_SPEED *
(targetColor.r - currentColor.r));
newColor.g = static_cast<std::uint8_t>(static_cast<float>(currentColor.g) +
TRANSITION_SPEED *
(targetColor.g - currentColor.g));
newColor.b = static_cast<std::uint8_t>(static_cast<float>(currentColor.b) +
TRANSITION_SPEED *
(targetColor.b - currentColor.b));
newColor.r = static_cast<std::uint8_t>(
static_cast<float>(currentColor.r) +
TRANSITION_SPEED * static_cast<float>(targetColor.r - currentColor.r));
newColor.g = static_cast<std::uint8_t>(
static_cast<float>(currentColor.g) +
TRANSITION_SPEED * static_cast<float>(targetColor.g - currentColor.g));
newColor.b = static_cast<std::uint8_t>(
static_cast<float>(currentColor.b) +
TRANSITION_SPEED * static_cast<float>(targetColor.b - currentColor.b));
newColor.a = 255;
m_shape.setFillColor(newColor);