oops forgot 2 files
[supertux.git] / src / object / particles.hpp
1 //  $Id: gameobjs.hpp 2806 2005-10-03 15:29:22Z matzebraun $
2 // 
3 //  SuperTux
4 //  Copyright (C) 2000 Bill Kendrick <bill@newbreedsoftware.com>
5 //  Copyright (C) 2004 Tobias Glaesser <tobi.web@gmx.de>
6 //
7 //  This program is free software; you can redistribute it and/or
8 //  modify it under the terms of the GNU General Public License
9 //  as published by the Free Software Foundation; either version 2
10 //  of the License, or (at your option) any later version.
11 //
12 //  This program 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 this program; if not, write to the Free Software
19 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
20 //  02111-1307, USA.
21 #ifndef SUPERTUX_PARTICLES_HPP
22 #define SUPERTUX_PARTICLES_HPP
23
24 #include "math/vector.hpp"
25 #include "game_object.hpp"
26 #include "timer.hpp"
27 #include "video/color.hpp"
28
29 class Particles : public GameObject
30 {
31 public:
32   Particles(const Vector& epicenter, int min_angle, int max_angle,
33             const Vector& initial_velocity, const Vector& acceleration,
34             int number, Color color, int size, float life_time,
35             int drawing_layer);
36   ~Particles();
37   
38   virtual void update(float elapsed_time);
39   virtual void draw(DrawingContext& context);
40
41 private:
42   Vector accel;
43   Timer timer;
44   bool live_forever;
45
46   Color color;
47   float size;
48   int drawing_layer;
49
50   struct Particle {
51     Vector pos, vel;
52 //     float angle;
53     };
54   std::vector <Particle*> particles;
55 };
56
57 #endif