2016-03-04 15:29:31 +00:00
|
|
|
#ifndef PTF_BALL_HPP
|
|
|
|
#define PTF_BALL_HPP
|
|
|
|
|
2016-03-08 17:07:21 +00:00
|
|
|
#include "object.hpp"
|
2016-03-04 15:29:31 +00:00
|
|
|
#include <SFML/Graphics.hpp>
|
|
|
|
#include <iostream>
|
|
|
|
|
2016-03-08 17:07:21 +00:00
|
|
|
class Ball : public Object {
|
2016-03-04 15:29:31 +00:00
|
|
|
protected:
|
|
|
|
sf::Vector2f velocity;
|
|
|
|
float mass;
|
|
|
|
|
|
|
|
public:
|
|
|
|
Ball();
|
|
|
|
|
2016-03-08 17:07:21 +00:00
|
|
|
/**
|
|
|
|
* Mise à jour de la position de la balle en fonction des forces
|
|
|
|
* qui lui sont appliquées
|
|
|
|
*/
|
|
|
|
void update(sf::Vector2f forces, float delta);
|
2016-03-04 15:29:31 +00:00
|
|
|
|
2016-03-08 17:07:21 +00:00
|
|
|
/**
|
|
|
|
* Dessine la balle dans la fenêtre donnée
|
|
|
|
*/
|
|
|
|
void draw(sf::RenderWindow& window);
|
2016-03-04 15:29:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|