restore trunk
[supertux.git] / src / object / gameobjs.hpp
1 //  $Id$
2 //
3 //  SuperTux
4 //  Copyright (C) 2006 Matthias Braun <matze@braunis.de>
5 //
6 //  This program is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU General Public License
8 //  as published by the Free Software Foundation; either version 2
9 //  of the License, or (at your option) any later version.
10 //
11 //  This program is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 //  GNU General Public License for more details.
15 //
16 //  You should have received a copy of the GNU General Public License
17 //  along with this program; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
19
20 #ifndef SUPERTUX_GAMEOBJS_H
21 #define SUPERTUX_GAMEOBJS_H
22
23 #include "video/surface.hpp"
24 #include "timer.hpp"
25 #include "game_object.hpp"
26 #include "moving_object.hpp"
27 #include "serializable.hpp"
28 #include "video/color.hpp"
29
30 /* Bounciness of distros: */
31 #define NO_BOUNCE 0
32 #define BOUNCE 1
33
34 class Sprite;
35
36 class BouncyCoin : public GameObject
37 {
38 public:
39   BouncyCoin(const Vector& pos);
40   ~BouncyCoin();
41   virtual void update(float elapsed_time);
42   virtual void draw(DrawingContext& context);
43
44 private:
45   Sprite* sprite;
46   Vector position;
47   Timer timer;
48 };
49
50 class BrokenBrick : public GameObject
51 {
52 public:
53   BrokenBrick(Sprite* sprite, const Vector& pos, const Vector& movement);
54   ~BrokenBrick();
55
56   virtual void update(float elapsed_time);
57   virtual void draw(DrawingContext& context);
58
59 private:
60   Timer timer;
61   Sprite* sprite;
62   Vector position;
63   Vector movement;
64 };
65
66 class FloatingText : public GameObject
67 {
68 public:
69   FloatingText(const Vector& pos, const std::string& text_);
70   FloatingText(const Vector& pos, int s);  // use this for score, for instance
71
72   virtual void update(float elapsed_time);
73   virtual void draw(DrawingContext& context);
74
75 private:
76   Vector position;
77   std::string text;
78   Timer timer;
79 };
80
81 class SmokeCloud : public GameObject
82 {
83 public:
84   SmokeCloud(const Vector& pos);
85   ~SmokeCloud();
86
87   virtual void update(float elapsed_time);
88   virtual void draw(DrawingContext& context);
89
90 private:
91   Sprite* sprite;
92   Timer timer;
93   Vector position;
94 };
95
96 #endif
97
98 /* Local Variables: */
99 /* mode:c++ */
100 /* End: */