skizzle/block.hpp

41 lines
786 B
C++
Raw Normal View History

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
class Block : public Object {
protected:
sf::CircleShape shape;
2016-03-08 16:46:33 +00:00
public:
Block(float x, float y) : Object(x,y), shape(80,4) {
shape.setFillColor(sf::Color(0,0,0));
}
// utilise le constructeur de Object
using Object::Object;
/**
* 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