4 // Copyright (C) 2000 Bill Kendrick <bill@newbreedsoftware.com>
5 // Copyright (C) 2004 Tobias Glaesser <tobi.web@gmx.de>
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.
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.
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
22 #ifndef SUPERTUX_GAMEOBJS_H
23 #define SUPERTUX_GAMEOBJS_H
25 #include "video/surface.h"
28 #include "math/physic.h"
29 #include "special/game_object.h"
30 #include "special/moving_object.h"
31 #include "serializable.h"
32 #include "utils/lispwriter.h"
34 /* Bounciness of distros: */
42 class BouncyCoin : public GameObject
45 BouncyCoin(const Vector& pos);
47 virtual void action(float elapsed_time);
48 virtual void draw(DrawingContext& context);
56 class BrokenBrick : public GameObject
59 BrokenBrick(Sprite* sprite, const Vector& pos, const Vector& movement);
62 virtual void action(float elapsed_time);
63 virtual void draw(DrawingContext& context);
72 class FloatingText : public GameObject
75 FloatingText(const Vector& pos, const std::string& text_);
76 FloatingText(const Vector& pos, int s); // use this for score, for instance
78 virtual void action(float elapsed_time);
79 virtual void draw(DrawingContext& context);
88 extern Sprite *img_trampoline;
90 class Trampoline : public MovingObject, public Serializable
93 Trampoline(LispReader& reader);
94 Trampoline(float x, float y);
96 virtual void write(LispWriter& writer);
97 virtual void action(float frame_ratio);
98 virtual void draw(DrawingContext& context);
100 virtual void collision(const MovingObject& other, int);
101 void collision(void *p_c_object, int c_object, CollisionType type);
104 enum { M_NORMAL, M_HELD } mode;
112 extern Sprite *img_smoke_cloud;
114 class SmokeCloud : public GameObject
117 SmokeCloud(const Vector& pos);
119 virtual void action(float elapsed_time);
120 virtual void draw(DrawingContext& context);
127 class Particles : public GameObject
130 Particles(const Vector& epicenter, int min_angle, int max_angle,
131 const Vector& initial_velocity, const Vector& acceleration,
132 int number, Color color, int size, float life_time, int drawing_layer);
135 virtual void action(float elapsed_time);
136 virtual void draw(DrawingContext& context);
151 std::vector <Particle*> particles;
154 void load_object_gfx();
155 void free_object_gfx();
159 /* Local Variables: */