- converted text_type into a class
[supertux.git] / src / gameobjs.h
1 //  $Id$
2 // 
3 //  SuperTux
4 //  Copyright (C) 2004 SuperTux Development Team, see AUTHORS for details
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 "type.h"
24 #include "texture.h"
25 #include "timer.h"
26 #include "scene.h"
27
28 /* Bounciness of distros: */
29 #define NO_BOUNCE 0
30 #define BOUNCE 1
31
32 class BouncyDistro
33 {
34  public:
35   base_type base;
36   
37   void init(float x, float y);
38   void action(double frame_ratio);
39   void draw(); 
40 };
41
42 extern Surface* img_distro[4];
43
44 #define BOUNCY_BRICK_MAX_OFFSET 8
45 #define BOUNCY_BRICK_SPEED 0.9
46
47 class Tile;
48
49 class BrokenBrick
50 {
51  public:
52   base_type base;
53   Timer timer;
54   Tile* tile;
55
56   void init(Tile* tile, float x, float y, float xm, float ym);
57   void action(double frame_ratio);
58   void draw();
59 };
60
61 class BouncyBrick
62 {
63  public:
64   float offset;
65   float offset_m;
66   int shape;
67   base_type base;
68
69   void init(float x, float y);
70   void action(double frame_ratio);
71   void draw();
72 };
73
74 class FloatingScore
75 {
76  public:
77   int value;
78   Timer timer;
79   base_type base;
80   
81   void init(float x, float y, int s);
82   void action(double frame_ratio);
83   void draw();
84 };
85
86 #endif 
87
88 /* Local Variables: */
89 /* mode:c++ */
90 /* End: */