Spécification de la taille en 32x directement

This commit is contained in:
Mattéo Delabre 2016-03-11 15:16:46 +01:00
parent d8993cb457
commit a5e36368e0
2 changed files with 4 additions and 2 deletions

View File

@ -1,7 +1,7 @@
#include "block.hpp"
void Block::draw(sf::RenderWindow& window) {
shape.setPosition(position * 32.f);
shape.setPosition(position);
window.draw(shape);
}

View File

@ -11,7 +11,9 @@ protected:
sf::RectangleShape shape;
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));
}