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
30 #include "collision.h"
31 #include "game_object.h"
33 #include "moving_object.h"
34 #include "lispwriter.h"
36 /* Bounciness of distros: */
40 class BouncyDistro : public GameObject, public Drawable
43 BouncyDistro(DisplayManager& displaymanager, const Vector& pos);
44 virtual void action(float elapsed_time);
45 virtual void draw(Camera& viewport, int layer);
52 extern Surface* img_distro[4];
54 #define BOUNCY_BRICK_MAX_OFFSET 8
55 #define BOUNCY_BRICK_SPEED 0.9
59 class BrokenBrick : public GameObject, public Drawable
62 BrokenBrick(DisplayManager& displaymanager, Tile* tile,
63 const Vector& pos, const Vector& movement);
65 virtual void action(float elapsed_time);
66 virtual void draw(Camera& viewport, int layer);
75 class BouncyBrick : public GameObject, public Drawable
78 BouncyBrick(DisplayManager& displaymanager, const Vector& pos);
79 virtual void action(float elapsed_time);
80 virtual void draw(Camera& viewport, int layer);
89 class FloatingScore : public GameObject, public Drawable
92 FloatingScore(DisplayManager& displaymanager, const Vector& pos, int s);
94 virtual void action(float elapsed_time);
95 virtual void draw(Camera& viewport, int layer);
103 class Trampoline : public MovingObject, public Drawable, public Serializable
106 Trampoline(DisplayManager& displaymanager, LispReader& reader);
108 virtual void write(LispWriter& writer);
109 virtual void action(float frame_ratio);
110 virtual void draw(Camera& viewport, int layer);
112 virtual void collision(const MovingObject& other, int);
113 void collision(void *p_c_object, int c_object, CollisionType type);
116 enum { M_NORMAL, M_HELD } mode;
123 class FlyingPlatform : public MovingObject, public Drawable, public Serializable
126 FlyingPlatform(DisplayManager& displaymanager, LispReader& reader);
128 virtual void write(LispWriter& writer);
129 virtual void action(float frame_ratio);
130 virtual void draw(Camera& viewport, int layer);
132 virtual void collision(const MovingObject& other, int);
133 void collision(void *p_c_object, int c_object, CollisionType type);
135 float get_vel_x() { return vel_x; }
136 float get_vel_y() { return vel_y; }
139 enum { M_NORMAL, M_HELD } mode;
142 std::vector<int> pos_x;
143 std::vector<int> pos_y;
146 float vel_x, vel_y; // calculated based in the velocity
153 void load_object_gfx();
157 /* Local Variables: */