Spécification de la taille en 32x directement
This commit is contained in:
parent
d8993cb457
commit
a5e36368e0
|
@ -1,7 +1,7 @@
|
||||||
#include "block.hpp"
|
#include "block.hpp"
|
||||||
|
|
||||||
void Block::draw(sf::RenderWindow& window) {
|
void Block::draw(sf::RenderWindow& window) {
|
||||||
shape.setPosition(position * 32.f);
|
shape.setPosition(position);
|
||||||
window.draw(shape);
|
window.draw(shape);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,9 @@ protected:
|
||||||
sf::RectangleShape shape;
|
sf::RectangleShape shape;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Block(float x, float y) : Object(x,y), shape(sf::Vector2f(32, 32)) {
|
static constexpr float GRID = 32;
|
||||||
|
|
||||||
|
Block(float x, float y) : Object(x, y), shape(sf::Vector2f(Block::GRID, Block::GRID)) {
|
||||||
shape.setFillColor(sf::Color(0, 0, 0));
|
shape.setFillColor(sf::Color(0, 0, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue