//
// SuperTux
// Copyright (C) 2004 Ingo Ruhnke <grumbel@gmx.de>
+// Copyright (C) 2006 Christoph Sommer <christoph.sommer@2006.expires.deltadevelopment.de>
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
#include "control/controller.hpp"
#include "statistics.hpp"
#include "timer.hpp"
+#include "screen.hpp"
#include "tile_manager.hpp"
#include "game_object.hpp"
+#include "console.hpp"
class Sprite;
class Menu;
};
/** */
-class WorldMap
+class WorldMap : public Screen
{
private:
Tux* tux;
- bool quit;
-
Surface* leveldot_green;
Surface* leveldot_red;
Surface* messagedot;
- Surface* teleporterdot;
+ Sprite* teleporterdot;
+ static WorldMap* current_;
+
+ Vector camera_offset;
std::string name;
std::string music;
TileMap* solids;
TileManager* tile_manager;
+
+ Console* console;
public:
struct SpecialTile
/** Optional flags: */
+ /** Sprite to render instead of guessing what image to draw */
+ Sprite* sprite;
+
/** Position to swap to player */
Vector teleport_dest;
WorldMap();
~WorldMap();
- /** Busy loop */
- void display();
-
void load_map();
void get_input();
void add_object(GameObject* object);
void clear_objects();
+ static WorldMap* current()
+ { return current_; }
+
+ void setup();
+
/** Update Tux position */
void update(float delta);
Vector get_next_tile(Vector pos, Direction direction);
const Tile* at(Vector pos);
+ /**
+ * gets called from the GameSession when a level has been successfully
+ * finished
+ */
+ void finished_level(const std::string& filename);
+
WorldMap::Level* at_level();
WorldMap::SpecialTile* at_special_tile();