7 // Author: Tobias Glaesser <tobi.web@gmx.de>, (C) 2003
9 // Copyright: See COPYING file that comes with this distribution
13 #ifndef SUPERTUX_WORLD_H
14 #define SUPERTUX_WORLD_H
21 #include "particlesystem.h"
23 /* Bounciness of distros: */
28 struct bouncy_distro_type
33 extern texture_type img_distro[4];
35 void bouncy_distro_init(bouncy_distro_type* pbouncy_distro, float x, float y);
36 void bouncy_distro_action(bouncy_distro_type* pbouncy_distro);
37 void bouncy_distro_draw(bouncy_distro_type* pbouncy_distro);
38 void bouncy_distro_collision(bouncy_distro_type* pbouncy_distro, int c_object);
40 #define BOUNCY_BRICK_MAX_OFFSET 8
41 #define BOUNCY_BRICK_SPEED 0.9
43 struct broken_brick_type
49 void broken_brick_init(broken_brick_type* pbroken_brick, float x, float y, float xm, float ym);
50 void broken_brick_action(broken_brick_type* pbroken_brick);
51 void broken_brick_draw(broken_brick_type* pbroken_brick);
53 struct bouncy_brick_type
61 void bouncy_brick_init(bouncy_brick_type* pbouncy_brick, float x, float y);
62 void bouncy_brick_action(bouncy_brick_type* pbouncy_brick);
63 void bouncy_brick_draw(bouncy_brick_type* pbouncy_brick);
65 struct floating_score_type
72 void floating_score_init(floating_score_type* pfloating_score, float x, float y, int s);
73 void floating_score_action(floating_score_type* pfloating_score);
74 void floating_score_draw(floating_score_type* pfloating_score);
76 /** Try to grab the coin at the given coordinates */
77 void trygrabdistro(float x, float y, int bounciness);
79 /** Try to break the brick at the given coordinates */
80 void trybreakbrick(float x, float y, bool small);
82 /** Try to get the content out of a bonus box, thus emptying it */
83 void tryemptybox(float x, float y, int col_side);
85 /** Try to bumb a badguy that might we walking above Tux, thus shaking
86 the tile which the badguy is walking on an killing him this way */
87 void trybumpbadguy(float x, float y);
90 /** The World class holds a level and all the game objects (badguys,
91 bouncy distros, etc) that are needed to run a game. */
96 std::vector<bouncy_distro_type> bouncy_distros;
97 std::vector<broken_brick_type> broken_bricks;
98 std::vector<bouncy_brick_type> bouncy_bricks;
99 std::vector<BadGuy> bad_guys;
100 std::vector<floating_score_type> floating_scores;
101 std::vector<upgrade_type> upgrades;
102 std::vector<bullet_type> bullets;
103 std::vector<ParticleSystem*> particle_systems;
111 void add_score(float x, float y, int s);
112 void add_bouncy_distro(float x, float y);
113 void add_broken_brick(float x, float y);
114 void add_broken_brick_piece(float x, float y, float xm, float ym);
115 void add_bouncy_brick(float x, float y);
116 void add_bad_guy(float x, float y, BadGuyKind kind);
117 void add_upgrade(float x, float y, int dir, int kind);
118 void add_bullet(float x, float y, float xm, int dir);
123 #endif /*SUPERTUX_WORLD_H*/