Constructeurs virtuels
This commit is contained in:
parent
6f0ff5131e
commit
62013124ab
|
@ -10,6 +10,7 @@ private:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Block(float x, float y);
|
Block(float x, float y);
|
||||||
|
virtual ~Block();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dessin du bloc dans la fenêtre donnée
|
* Dessin du bloc dans la fenêtre donnée
|
||||||
|
|
|
@ -32,6 +32,7 @@ protected:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Object(float x, float y);
|
Object(float x, float y);
|
||||||
|
virtual ~Object();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dessine l'objet dans la fenêtre donnée
|
* Dessine l'objet dans la fenêtre donnée
|
||||||
|
|
|
@ -17,6 +17,7 @@ protected:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Player(float x, float y);
|
Player(float x, float y);
|
||||||
|
virtual ~Player();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dessine la balle dans la fenêtre donnée
|
* Dessine la balle dans la fenêtre donnée
|
||||||
|
|
|
@ -12,6 +12,10 @@ Block::Block(float x, float y) : Object(x, y) {
|
||||||
sprite.setOrigin(sf::Vector2f(Constants::GRID / 2, Constants::GRID / 2));
|
sprite.setOrigin(sf::Vector2f(Constants::GRID / 2, Constants::GRID / 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Block::~Block() {
|
||||||
|
Object::~Object();
|
||||||
|
}
|
||||||
|
|
||||||
void Block::draw(Manager& manager) {
|
void Block::draw(Manager& manager) {
|
||||||
Object::draw(manager);
|
Object::draw(manager);
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
#include "game.hpp"
|
#include "game.hpp"
|
||||||
#include "constants.hpp"
|
#include "constants.hpp"
|
||||||
|
#include "player.hpp"
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <queue>
|
#include <queue>
|
||||||
|
|
||||||
#include "player.hpp"
|
|
||||||
|
|
||||||
Game::Game() : accumulator(0.f) {
|
Game::Game() : accumulator(0.f) {
|
||||||
if (!music.openFromFile("./res/music_lvl1.wav")) {
|
if (!music.openFromFile("./res/music_lvl1.wav")) {
|
||||||
// erreur
|
// erreur
|
||||||
|
@ -18,6 +17,7 @@ Game::Game() : accumulator(0.f) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Game::~Game() {
|
Game::~Game() {
|
||||||
|
View::~View();
|
||||||
clear();
|
clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,8 @@ Object::Object(float x, float y) :
|
||||||
dynamic_friction(0.2f),
|
dynamic_friction(0.2f),
|
||||||
layer(Constants::DEFAULT_LAYER) {}
|
layer(Constants::DEFAULT_LAYER) {}
|
||||||
|
|
||||||
|
Object::~Object() {}
|
||||||
|
|
||||||
sf::Vector2f Object::getForces(
|
sf::Vector2f Object::getForces(
|
||||||
const Manager& manager, const std::vector<Object*>& objects
|
const Manager& manager, const std::vector<Object*>& objects
|
||||||
) const {
|
) const {
|
||||||
|
|
|
@ -9,6 +9,10 @@ Player::Player(float x, float y) : Object(x, y) {
|
||||||
sprite.setOrigin(sf::Vector2f(getRadius(), getRadius()));
|
sprite.setOrigin(sf::Vector2f(getRadius(), getRadius()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Player::~Player() {
|
||||||
|
Object::~Object();
|
||||||
|
}
|
||||||
|
|
||||||
sf::Vector2f Player::getForces(const Manager& manager, const std::vector<Object*>& objects) const {
|
sf::Vector2f Player::getForces(const Manager& manager, const std::vector<Object*>& objects) const {
|
||||||
sf::Vector2f forces = Object::getForces(manager, objects);
|
sf::Vector2f forces = Object::getForces(manager, objects);
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
#include "view.hpp"
|
||||||
|
|
||||||
|
View::~View() {}
|
Loading…
Reference in New Issue