Affichage des blocs aimantés en couleur
This commit is contained in:
parent
f0632db66f
commit
41d5c3696c
|
@ -1,6 +1,14 @@
|
||||||
#include "block.hpp"
|
#include "block.hpp"
|
||||||
|
|
||||||
void Block::draw(sf::RenderWindow& window) {
|
void Block::draw(sf::RenderWindow& window) {
|
||||||
|
if (charge > 0) {
|
||||||
|
shape.setFillColor(sf::Color(0, 0, 255));
|
||||||
|
} else if (charge < 0) {
|
||||||
|
shape.setFillColor(sf::Color(255, 0, 0));
|
||||||
|
} else {
|
||||||
|
shape.setFillColor(sf::Color(0, 0, 0));
|
||||||
|
}
|
||||||
|
|
||||||
shape.setPosition(position);
|
shape.setPosition(position);
|
||||||
window.draw(shape);
|
window.draw(shape);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue