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