X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fworldmap.h;h=fa71bbce3b714d74249ae8a20dec5e026e131fda;hb=f00cab0c347263a82758e8c6799f28e80d6162f2;hp=dd5d03a99bfeff3b70c1bd28c47b2d0ff99e8ded;hpb=523d415707de9f777729534f467779d4c5acdf6e;p=supertux.git diff --git a/src/worldmap.h b/src/worldmap.h index dd5d03a99..fa71bbce3 100644 --- a/src/worldmap.h +++ b/src/worldmap.h @@ -30,9 +30,13 @@ #include "statistics.h" #include "timer.h" #include "tile_manager.h" +#include "game_object.h" class Sprite; class Menu; +class SpawnPoint; +class GameObject; +class TileMap; extern Menu* worldmap_menu; namespace WorldMapNS { @@ -59,7 +63,7 @@ Direction reverse_dir(Direction d); class WorldMap; -class Tux +class Tux : public GameObject { public: Direction back_direction; @@ -108,13 +112,10 @@ private: std::string name; std::string music; - std::vector tilemap; - int width; - int height; + typedef std::vector GameObjects; + GameObjects game_objects; + TileMap* solids; - int start_x; - int start_y; - TileManager* tile_manager; public: @@ -157,9 +158,8 @@ public: /** Check if this level should be vertically flipped */ bool vertical_flip; - /** Filename of the extro text to show once the level is - successfully completed */ - std::string extro_filename; + /** Script that is run when the level is successfully finished */ + std::string extro_script; /** Go to this world */ std::string next_worldmap; @@ -187,16 +187,17 @@ private: typedef std::vector SpecialTiles; SpecialTiles special_tiles; - typedef std::vector Levels; Levels levels; + typedef std::vector SpawnPoints; + SpawnPoints spawn_points; MusicRef song; Vector offset; std::string savegame_file; - std::string intro_filename; + std::string intro_script; bool intro_displayed; void get_level_title(Level& level); @@ -219,6 +220,9 @@ public: void get_input(); + void add_object(GameObject* object); + void clear_objects(); + /** Update Tux position */ void update(float delta); @@ -244,16 +248,10 @@ public: void loadmap(const std::string& filename); const std::string& get_world_title() const - { return name; } + { return name; } - const int& get_start_x() const - { return start_x; } - - const int& get_start_y() const - { return start_y; } - void set_map_filename(std::string filename) - { map_filename = filename; } + { map_filename = filename; } private: void on_escape_press();