1 /* 2 Copyright (C) 2000 Xavier Hosxe <xhosxe@free.fr> 3 4 This program is free software; you can redistribute it and/or modify 5 it under the terms of the GNU General Public License as published by 6 the Free Software Foundation; either version 2 of the License, or 7 (at your option) any later version. 8 9 This program is distributed in the hope that it will be useful, 10 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 GNU General Public License for more details. 13 14 You should have received a copy of the GNU General Public License 15 along with this program; if not, write to the Free Software 16 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 */ 18 19 20 #ifndef __EXPLOSION__ 21 #define __EXPLOSION__ 22 23 #include "sprite.hpp" 24 #include "myship.hpp" 25 #include "diamond.hpp" 26 27 class Explosion : public Sprite { 28 public: 29 Explosion(Sprite *sprite, int size, int sound = 1,int pieces = 1, float x=99, float y=99, float z=99); 30 void draw(); 31 void collision(Sprite*contact); 32 void move(); getFrom()33 type_sprites getFrom() { return from_ ; } 34 protected: 35 int nSmoke; 36 float currentSize_; 37 float x1_,x2_,x3_,x4_,r1_; 38 type_sprites from_; 39 int pieces_; 40 }; 41 42 class PieceOfShip : public Sprite { 43 public : 44 PieceOfShip(Sprite *sprite, int size); 45 ~PieceOfShip(); 46 void draw(); 47 void drawShadowable(); 48 void collision(Sprite*contact); 49 void move(); 50 protected: 51 float *ax_; 52 float *ay_; 53 float *az_; 54 float *adx_; 55 float *ady_; 56 float *adz_; 57 float *acolor_; 58 float *asizex_; 59 float *asizey_; 60 float *aalpha_; 61 float *arotate_; 62 int *atexture_; 63 int cptAlive_; 64 int*atype_; 65 short *alive_; 66 int size_; 67 type_sprites from_; 68 int fumee1; 69 float period_ ; 70 }; 71 72 class ExplosionJustSmoke : public Sprite { 73 public: 74 ExplosionJustSmoke(Sprite *sprite, float size); 75 ExplosionJustSmoke(Sprite *sprite,float x, float y, float z, float size); 76 void draw(); 77 void collision(Sprite*contact); 78 void move(); 79 protected: 80 int nSmoke; 81 float currentSize_; 82 float x1_,x2_,x3_,x4_,r1_; 83 }; 84 class ExplosionMark : public Sprite { 85 public: 86 ExplosionMark(Sprite *sprite, int size); 87 void draw(); 88 void collision(Sprite*contact); 89 void move(); 90 protected: 91 float size_; 92 }; 93 94 95 96 class SpecialEffect1 : public Sprite { 97 public: 98 SpecialEffect1(Sprite *sprite, Diamond::Type type); 99 ~SpecialEffect1(); 100 void draw(); 101 void collision(Sprite*contact); 102 void move(); 103 void receiveEvent(Sprite*sprite); 104 void iJustDied(); 105 protected: 106 float maxLife_; 107 Sprite *toFollow_; 108 int nPart_; 109 float currentTime; 110 float *pX_, *pY_, *pZ_, *life_; 111 Diamond::Type diamondType_ ; 112 113 }; 114 115 #endif 116 117