X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fworldmap.h;h=fa71bbce3b714d74249ae8a20dec5e026e131fda;hb=f00cab0c347263a82758e8c6799f28e80d6162f2;hp=5899f8c14f0bf962045f77287c1e42bd6380c533;hpb=c0093d25093395cb62fc2526ab42be65a9f015b8;p=supertux.git diff --git a/src/worldmap.h b/src/worldmap.h index 5899f8c14..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; @@ -82,7 +86,7 @@ public: ~Tux(); void draw(DrawingContext& context); - void action(float elapsed_time); + void update(float elapsed_time); void set_direction(Direction dir); @@ -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; @@ -178,7 +178,7 @@ public: }; /** Variables to deal with the passive map messages */ - Timer2 passive_message_timer; + Timer passive_message_timer; std::string passive_message; private: @@ -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,20 +248,15 @@ 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(); - void parse_special_tiles(const lisp::Lisp* lisp); + void parse_special_tile(const lisp::Lisp* lisp); + void parse_level_tile(const lisp::Lisp* lisp); }; } // namespace WorldMapNS