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"
24 /** Try to grab the coin at the given coordinates */
25 void trygrabdistro(float x, float y, int bounciness);
27 /** Try to break the brick at the given coordinates */
28 void trybreakbrick(float x, float y, bool small);
30 /** Try to get the content out of a bonus box, thus emptying it */
31 void tryemptybox(float x, float y, int col_side);
33 /** Try to bumb a badguy that might we walking above Tux, thus shaking
34 the tile which the badguy is walking on an killing him this way */
35 void trybumpbadguy(float x, float y);
38 /** The World class holds a level and all the game objects (badguys,
39 bouncy distros, etc) that are needed to run a game. */
45 std::vector<bouncy_distro_type> bouncy_distros;
46 std::vector<broken_brick_type> broken_bricks;
47 std::vector<bouncy_brick_type> bouncy_bricks;
48 std::vector<floating_score_type> floating_scores;
50 std::vector<BadGuy> bad_guys;
51 std::vector<upgrade_type> upgrades;
52 std::vector<bullet_type> bullets;
53 std::vector<ParticleSystem*> particle_systems;
55 static World* current_;
57 static World* current() { return current_; }
62 Level* get_level() { return level; }
70 /** Load data for this level:
71 Returns -1, if the loading of the level failed. */
72 int load(const char* subset, int level);
74 /** Load data for this level:
75 Returns -1, if the loading of the level failed. */
76 int load(const std::string& filename);
78 void activate_particle_systems();
79 void activate_bad_guys();
81 void add_score(float x, float y, int s);
82 void add_bouncy_distro(float x, float y);
83 void add_broken_brick(Tile* tile, float x, float y);
84 void add_broken_brick_piece(Tile* tile, float x, float y, float xm, float ym);
85 void add_bouncy_brick(float x, float y);
86 void add_bad_guy(float x, float y, BadGuyKind kind);
87 void add_upgrade(float x, float y, int dir, int kind);
88 void add_bullet(float x, float y, float xm, int dir);
93 #endif /*SUPERTUX_WORLD_H*/