10 #include "screen/drawing_context.h"
32 /** This class holds a sector (a part of a level) and all the game objects
33 * (badguys, player, background, tilemap, ...)
41 /// read sector from lisp file
42 void parse(LispReader& reader);
43 void parse_old_format(LispReader& reader);
44 /// write sector to lisp file
45 void write(LispWriter& writer);
47 /// activates this sector (change music, intialize player class, ...)
48 void activate(const std::string& spawnpoint = "main");
50 void action(float elapsed_time);
51 void draw(DrawingContext& context);
54 void add_object(GameObject* object);
56 const std::string& get_name() const
59 void play_music(int musictype);
62 /** Checks for all possible collisions. And calls the
63 collision_handlers, which the collision_objects provide for this
65 void collision_handler();
67 void add_score(const Vector& pos, int s);
68 void add_bouncy_distro(const Vector& pos);
69 void add_broken_brick(const Vector& pos, Tile* tile);
70 void add_broken_brick_piece(const Vector& pos,
71 const Vector& movement, Tile* tile);
72 void add_bouncy_brick(const Vector& pos);
74 BadGuy* add_bad_guy(float x, float y, BadGuyKind kind);
76 void add_upgrade(const Vector& pos, Direction dir, UpgradeKind kind);
77 bool add_bullet(const Vector& pos, float xm, Direction dir);
79 /** Try to grab the coin at the given coordinates */
80 void trygrabdistro(const Vector& pos, int bounciness);
82 /** Try to break the brick at the given coordinates */
83 bool trybreakbrick(const Vector& pos, bool small);
85 /** Try to get the content out of a bonus box, thus emptying it */
86 void tryemptybox(const Vector& pos, Direction col_side);
88 /** Try to bumb a badguy that might we walking above Tux, thus shaking
89 the tile which the badguy is walking on an killing him this way */
90 void trybumpbadguy(const Vector& pos);
93 static Sector* current()
99 static Sector* _current;
103 std::string song_title;
105 MusicRef level_song_fast;
110 // some special objects, where we need direct access
113 Background* background;
117 typedef std::vector<BadGuy*> BadGuys;
119 typedef std::vector<Trampoline*> Trampolines;
120 Trampolines trampolines;
121 typedef std::vector<FlyingPlatform*> FlyingPlatforms;
122 FlyingPlatforms flying_platforms;
124 std::vector<Upgrade*> upgrades;
125 std::vector<Bullet*> bullets;
128 typedef std::vector<GameObject*> GameObjects;
129 GameObjects gameobjects;
132 typedef std::vector<SpawnPoint*> SpawnPoints;
133 SpawnPoints spawnpoints;
136 bool counting_distros;