Correction du style de code
This commit is contained in:
parent
c2a5edf257
commit
2e3d5d7aac
11
ball.cpp
11
ball.cpp
|
@ -1,13 +1,12 @@
|
||||||
#include "ball.hpp"
|
#include "ball.hpp"
|
||||||
|
|
||||||
void Ball::draw(sf::RenderWindow& window) {
|
void Ball::draw(sf::RenderWindow& window) {
|
||||||
|
// chargement de la texture de test
|
||||||
//chargement de la texture de test
|
if (!texture.loadFromFile("./Images/texture_test.jpeg")) {
|
||||||
if (!texture.loadFromFile("./Images/texture_test.jpeg"))
|
// erreur
|
||||||
{
|
|
||||||
//erreur
|
|
||||||
}
|
}
|
||||||
shape.setTexture(&texture);
|
|
||||||
|
shape.setTexture(&texture);
|
||||||
|
|
||||||
shape.setPosition(position);
|
shape.setPosition(position);
|
||||||
window.draw(shape);
|
window.draw(shape);
|
||||||
|
|
2
ball.hpp
2
ball.hpp
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
class Ball : public PhysicsObject {
|
class Ball : public PhysicsObject {
|
||||||
protected:
|
protected:
|
||||||
sf::Texture texture;
|
sf::Texture texture;
|
||||||
sf::CircleShape shape;
|
sf::CircleShape shape;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
13
block.cpp
13
block.cpp
|
@ -1,13 +1,12 @@
|
||||||
#include "block.hpp"
|
#include "block.hpp"
|
||||||
|
|
||||||
void Block::draw(sf::RenderWindow& window) {
|
void Block::draw(sf::RenderWindow& window) {
|
||||||
|
// chargement de la texture de test
|
||||||
//chargement de la texture de test
|
if (!texture.loadFromFile("./Images/texture_test.jpeg")) {
|
||||||
if (!texture.loadFromFile("./Images/texture_test.jpeg"))
|
// erreur
|
||||||
{
|
|
||||||
//erreur
|
|
||||||
}
|
}
|
||||||
shape.setTexture(&texture);
|
|
||||||
|
shape.setTexture(&texture);
|
||||||
|
|
||||||
if (charge > 0) {
|
if (charge > 0) {
|
||||||
shape.setFillColor(sf::Color(0, 0, 255));
|
shape.setFillColor(sf::Color(0, 0, 255));
|
||||||
|
@ -19,8 +18,6 @@ void Block::draw(sf::RenderWindow& window) {
|
||||||
|
|
||||||
shape.setPosition(position);
|
shape.setPosition(position);
|
||||||
window.draw(shape);
|
window.draw(shape);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Block::update(State state) {
|
void Block::update(State state) {
|
||||||
|
|
Loading…
Reference in New Issue