projects
/
supertux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
define APPDATADIR
[supertux.git]
/
src
/
worldmap.h
diff --git
a/src/worldmap.h
b/src/worldmap.h
index
dd5d03a
..
fa71bbc
100644
(file)
--- a/
src/worldmap.h
+++ b/
src/worldmap.h
@@
-30,9
+30,13
@@
#include "statistics.h"
#include "timer.h"
#include "tile_manager.h"
#include "statistics.h"
#include "timer.h"
#include "tile_manager.h"
+#include "game_object.h"
class Sprite;
class Menu;
class Sprite;
class Menu;
+class SpawnPoint;
+class GameObject;
+class TileMap;
extern Menu* worldmap_menu;
namespace WorldMapNS {
extern Menu* worldmap_menu;
namespace WorldMapNS {
@@
-59,7
+63,7
@@
Direction reverse_dir(Direction d);
class WorldMap;
class WorldMap;
-class Tux
+class Tux
: public GameObject
{
public:
Direction back_direction;
{
public:
Direction back_direction;
@@
-108,13
+112,10
@@
private:
std::string name;
std::string music;
std::string name;
std::string music;
-
std::vector<int> tilemap
;
-
int width
;
-
int height
;
+
typedef std::vector<GameObject*> GameObjects
;
+
GameObjects game_objects
;
+
TileMap* solids
;
- int start_x;
- int start_y;
-
TileManager* tile_manager;
public:
TileManager* tile_manager;
public:
@@
-157,9
+158,8
@@
public:
/** Check if this level should be vertically flipped */
bool vertical_flip;
/** 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;
/** Go to this world */
std::string next_worldmap;
@@
-187,16
+187,17
@@
private:
typedef std::vector<SpecialTile> SpecialTiles;
SpecialTiles special_tiles;
typedef std::vector<SpecialTile> SpecialTiles;
SpecialTiles special_tiles;
-
typedef std::vector<Level> Levels;
Levels levels;
typedef std::vector<Level> Levels;
Levels levels;
+ typedef std::vector<SpawnPoint*> SpawnPoints;
+ SpawnPoints spawn_points;
MusicRef song;
Vector offset;
std::string savegame_file;
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);
bool intro_displayed;
void get_level_title(Level& level);
@@
-219,6
+220,9
@@
public:
void get_input();
void get_input();
+ void add_object(GameObject* object);
+ void clear_objects();
+
/** Update Tux position */
void update(float delta);
/** 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
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)
void set_map_filename(std::string filename)
-
{ map_filename = filename; }
+ { map_filename = filename; }
private:
void on_escape_press();
private:
void on_escape_press();