cecd274fa39194c0b116685f219566dd42c190d5
[supertux.git] / src / world.h
1 //
2 // Interface: world
3 //
4 // Description: 
5 //
6 //
7 // Author: Tobias Glaesser <tobi.web@gmx.de>, (C) 2003
8 //
9 // Copyright: See COPYING file that comes with this distribution
10 //
11 //
12
13 #ifndef SUPERTUX_WORLD_H
14 #define SUPERTUX_WORLD_H
15
16 #include <SDL.h>
17 #include "type.h"
18
19 typedef struct bouncy_distro_type /*It is easier to read the sources IMHO, if we don't write something like int a,b,c; */
20   {
21     int alive;
22     float x;
23     float y;
24     float ym;
25   }
26 bouncy_distro_type;
27
28 texture_type img_distro[4];
29
30 void bouncy_distro_init(bouncy_distro_type* pbouncy_distro);
31 void bouncy_distro_action(bouncy_distro_type* pbouncy_distro);
32 void bouncy_distro_draw(bouncy_distro_type* pbouncy_distro);
33 void bouncy_distro_collision(bouncy_distro_type* pbouncy_distro, int c_object);
34
35 #define BOUNCY_BRICK_MAX_OFFSET 8
36 #define BOUNCY_BRICK_SPEED 4
37
38 typedef struct broken_brick_type
39   {
40     int alive;
41     float x;
42     float y;
43     float xm;
44     float ym;
45   }
46 broken_brick_type;
47
48 void broken_brick_action(broken_brick_type* pbroken_brick);
49 void broken_brick_draw(broken_brick_type* pbroken_brick);
50
51 typedef struct bouncy_brick_type
52   {
53     int alive;
54     float x;
55     float y;
56     float offset;
57     float offset_m;
58     int shape;
59   }
60 bouncy_brick_type;
61
62 void bouncy_brick_action(bouncy_brick_type* pbouncy_brick);
63 void bouncy_brick_draw(bouncy_brick_type* pbouncy_brick);
64
65 typedef struct floating_score_type
66   {
67     int alive;
68     float x;
69     float y;
70     int value;
71     timer_type timer;
72   }
73 floating_score_type;
74
75 void floating_score_init(floating_score_type* pfloating_score, int x, int y, int s);
76 void floating_score_action(floating_score_type* pfloating_score);
77 void floating_score_draw(floating_score_type* pfloating_score);
78
79 #endif /*SUPERTUX_WORLD_H*/
80