00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef HEADER_SUPERTUX_OBJECT_PARTICLES_HPP
00018 #define HEADER_SUPERTUX_OBJECT_PARTICLES_HPP
00019
00020 #include "math/vector.hpp"
00021 #include "supertux/game_object.hpp"
00022 #include "supertux/timer.hpp"
00023 #include "video/color.hpp"
00024
00025 class Particles : public GameObject
00026 {
00027 public:
00028 Particles(const Vector& epicenter, int min_angle, int max_angle,
00029 const Vector& initial_velocity, const Vector& acceleration,
00030 int number, Color color, int size, float life_time,
00031 int drawing_layer);
00032 ~Particles();
00033
00034 virtual void update(float elapsed_time);
00035 virtual void draw(DrawingContext& context);
00036
00037 private:
00038 struct Particle {
00039 Vector pos, vel;
00040
00041 Particle() :
00042 pos(),
00043 vel()
00044 {}
00045
00046 };
00047
00048 private:
00049 Vector accel;
00050 Timer timer;
00051 bool live_forever;
00052
00053 Color color;
00054 float size;
00055 int drawing_layer;
00056
00057 std::vector <Particle*> particles;
00058 };
00059
00060 #endif
00061
00062