2016-03-08 22:28:50 +00:00
|
|
|
#ifndef __PTF_BLOCK_HPP__
|
|
|
|
#define __PTF_BLOCK_HPP__
|
2016-03-08 16:46:33 +00:00
|
|
|
|
|
|
|
#include <SFML/Graphics.hpp>
|
|
|
|
#include <iostream>
|
2016-03-08 18:50:37 +00:00
|
|
|
#include "object.hpp"
|
2016-03-08 22:27:44 +00:00
|
|
|
#include "state.hpp"
|
2016-03-08 16:46:33 +00:00
|
|
|
|
2016-03-08 17:07:34 +00:00
|
|
|
class Block : public Object {
|
2016-03-10 20:47:19 +00:00
|
|
|
protected:
|
|
|
|
sf::CircleShape shape;
|
|
|
|
|
2016-03-08 16:46:33 +00:00
|
|
|
public:
|
2016-03-10 20:47:19 +00:00
|
|
|
Block(float x, float y) : Object(x,y), shape(80,4) {
|
|
|
|
shape.setFillColor(sf::Color(0,0,0));
|
|
|
|
}
|
|
|
|
|
2016-03-09 19:01:15 +00:00
|
|
|
// utilise le constructeur de Object
|
|
|
|
using Object::Object;
|
|
|
|
|
2016-03-08 17:07:34 +00:00
|
|
|
/**
|
|
|
|
* Dessin du bloc dans la fenêtre donnée
|
|
|
|
*/
|
2016-03-08 16:46:33 +00:00
|
|
|
void draw(sf::RenderWindow& window);
|
2016-03-08 18:50:37 +00:00
|
|
|
|
2016-03-08 20:15:33 +00:00
|
|
|
/**
|
|
|
|
* Met à jour l'objet juste avant le dessin d'une frame
|
2016-03-08 22:27:44 +00:00
|
|
|
* Reçoit l'état actuel du moteur
|
2016-03-08 20:15:33 +00:00
|
|
|
*/
|
|
|
|
void update(State state);
|
|
|
|
|
2016-03-08 18:50:37 +00:00
|
|
|
/**
|
|
|
|
* Détermine la couche d'affichage de l'objet
|
|
|
|
*/
|
|
|
|
unsigned int getLayer() {
|
|
|
|
return 0;
|
|
|
|
}
|
2016-03-08 16:46:33 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|