Correction affichage joueur sans charge
This commit is contained in:
parent
3a7a3b4978
commit
7e74ba7393
|
@ -88,7 +88,7 @@ void Player::draw(Level& level) {
|
||||||
if (previous_position != sf::Vector2f(0, 0)) {
|
if (previous_position != sf::Vector2f(0, 0)) {
|
||||||
sf::Vector2f right_dir = level.getRightDirection();
|
sf::Vector2f right_dir = level.getRightDirection();
|
||||||
sf::Vector2f diff = getPosition() - previous_position;
|
sf::Vector2f diff = getPosition() - previous_position;
|
||||||
|
|
||||||
float rotate = (right_dir.x * diff.x + right_dir.y * diff.y) * 3 / 200;
|
float rotate = (right_dir.x * diff.x + right_dir.y * diff.y) * 3 / 200;
|
||||||
sprite.rotate(rotate);
|
sprite.rotate(rotate);
|
||||||
}
|
}
|
||||||
|
@ -108,7 +108,7 @@ void Player::draw(Level& level) {
|
||||||
} else if (getCharge() < 0) {
|
} else if (getCharge() < 0) {
|
||||||
sprite.setFillColor(sf::Color(239, 83, 80));
|
sprite.setFillColor(sf::Color(239, 83, 80));
|
||||||
} else {
|
} else {
|
||||||
sprite.setFillColor(sf::Color::Transparent);
|
sprite.setFillColor(sf::Color::White);
|
||||||
}
|
}
|
||||||
|
|
||||||
// dessin des sprites
|
// dessin des sprites
|
||||||
|
|
Loading…
Reference in New Issue