1 /***************************************************************************** 2 * 3 * Copyright (C) 2003 C�dric Br�gardis <cedric.bregardis@free.fr> 4 * 5 * This file is part of BRIQUOLO 6 * 7 * BRIQUOLO is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation; either version 2 of the License, or 10 * (at your option) any later version. 11 * 12 * BRIQUOLO is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with BRIQUOLO; if not, write to the Free Software 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 * 21 *****************************************************************************/ 22 #ifndef _BALLE 23 #define _BALLE 24 25 #include "ElementCollision.h" 26 #include <MOGL_Objet.h> 27 #include <MOGL_GestionnaireTexture.h> 28 #include <MOGL_MatriceTransformation.h> 29 #include <MOGL_Temporisation.h> 30 31 class TraceBalle; 32 33 class Balle: public ElementCollision, public MOGL_Action 34 { 35 protected: 36 static MOGL_Objet * _ObjetSource; 37 TraceBalle * _TraceBalle; 38 double _Vitesse; 39 double _Rayon; 40 double _FacteurTaille; 41 const double _RayonInit; 42 MOGL_MatriceTransformation _MatriceRotation; 43 bool _SuperPuissance; 44 MOGL_Temporisation _TempoSuperPuissance; 45 int _CanalSonSuperPuissance; 46 double _TempsMax; 47 double _DirectionX; 48 double _DirectionY; 49 double _FacteurAcceleration; 50 51 protected: //ACTIONS 52 void _OnFinSuperPuissance(); 53 54 public: 55 56 int val; 57 58 Balle(); 59 Balle(const Balle & p_Balle); 60 61 virtual ~Balle(); 62 63 //void PreparerDeplacement(double p_Facteur); 64 void Deplacer(double p_Temps); 65 void SetDirection(double p_DirectionX, double p_DirectionY); 66 double GetDirectionX() const; 67 double GetDirectionY() const; 68 69 void SetVitesseTotale(double p_VitesseX, double p_VitesseY); 70 double GetVitesseTotaleX() const; 71 double GetVitesseTotaleY() const; 72 73 double GetVitesseBase() const; 74 void SetVitesseBase(double p_Vitesse); 75 76 double GetVitesseTotale() const; 77 void SetVitesseTotale(double p_Vitesse); 78 79 double GetRayon() const; 80 81 void SetPosition(double p_X, double p_Y); 82 void SetTaille(double p_Facteur); 83 84 bool GetSuperPuissance() const; 85 void SetSuperPuissance(bool p_Actif); 86 87 double GetTempsMax() const; 88 void SetTempsMax(double p_TempsMax); 89 90 void MajVitesse(); 91 92 static void PreCharger(MOGL_GestionnaireTexture * p_GestionnaireTexture); 93 94 void AddAcceleration(double p_Facteur); 95 void SetFacteurAcceleration(double p_Facteur); 96 double GetFacteurAcceleration() const; 97 98 Struct_Collision TesterCollision(Balle * p_Balle); 99 }; 100 101 #endif 102