From a5e36368e0715129f13f3f4b1d176efb04610933 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matt=C3=A9o=20Delabre?= Date: Fri, 11 Mar 2016 15:16:46 +0100 Subject: [PATCH] =?UTF-8?q?Sp=C3=A9cification=20de=20la=20taille=20en=2032?= =?UTF-8?q?x=20directement?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- block.cpp | 2 +- block.hpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/block.cpp b/block.cpp index 789653d..2ee62dd 100644 --- a/block.cpp +++ b/block.cpp @@ -1,7 +1,7 @@ #include "block.hpp" void Block::draw(sf::RenderWindow& window) { - shape.setPosition(position * 32.f); + shape.setPosition(position); window.draw(shape); } diff --git a/block.hpp b/block.hpp index 692baad..cd953da 100644 --- a/block.hpp +++ b/block.hpp @@ -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)); }