From d6e39b2e45380efb6100a1264892e28a5f7a125b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matt=C3=A9o=20Delabre?= Date: Tue, 8 Mar 2016 19:50:21 +0100 Subject: [PATCH] =?UTF-8?q?Ball=20h=C3=A9rite=20de=20PhysicsObjet=20et=20a?= =?UTF-8?q?jout=20de=20la=20couche=20de=20Ball?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ball.hpp | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/ball.hpp b/ball.hpp index 4155280..06a4ca4 100644 --- a/ball.hpp +++ b/ball.hpp @@ -1,28 +1,32 @@ #ifndef PTF_BALL_HPP #define PTF_BALL_HPP -#include "object.hpp" #include #include +#include "state.hpp" +#include "physics_object.hpp" -class Ball : public Object { +class Ball : public PhysicsObject { protected: - sf::Vector2f velocity; - float mass; + /** + * Calcule les forces appliquées à l'objet + */ + void getForces(State state); public: Ball(); - /** - * Mise à jour de la position de la balle en fonction des forces - * qui lui sont appliquées - */ - void update(sf::Vector2f forces, float delta); - /** * Dessine la balle dans la fenêtre donnée */ void draw(sf::RenderWindow& window); + + /** + * Détermine la couche d'affichage de l'objet + */ + unsigned int getLayer() { + return 1; + } }; #endif