7 // Author: Tobias Glaesser <tobi.web@gmx.de>, (C) 2003
9 // Copyright: See COPYING file that comes with this distribution
13 #ifndef SUPERTUX_LEVEL_H
14 #define SUPERTUX_LEVEL_H
19 #include "lispreader.h"
23 /** This type holds meta-information about a level-subset.
24 It could be extended to handle manipulation of subsets. */
29 static void create(const std::string& subset_name);
30 void load(char *subset);
36 std::string description;
41 void parse(lisp_object_t* cursor);
44 #define LEVEL_NAME_MAX 20
61 std::string song_title;
62 std::string bkgd_image;
63 std::string particle_system;
64 std::vector<unsigned int> bg_tiles[15]; /* Tiles in the background */
65 std::vector<unsigned int> ia_tiles[15]; /* Tiles which can interact in the game (solids for example)*/
66 std::vector<unsigned int> fg_tiles[15]; /* Tiles in the foreground */
76 std::vector<BadGuyData> badguy_data;
79 Level(const std::string& subset, int level);
80 Level(const std::string& filename);
82 /** Will the Level structure with default values */
85 /** Cleanup the level struct from allocated tile data and such */
88 /** Load data for this level:
89 Returns -1, if the loading of the level failed. */
90 int load(const std::string& subset, int level);
92 /** Load data for this level:
93 Returns -1, if the loading of the level failed. */
94 int load(const std::string& filename);
102 void save(const char* subset, int level);
104 /** Edit a piece of the map! */
105 void change(float x, float y, int tm, unsigned int c);
107 /** Resize the level to a new width */
108 void change_size (int new_width);
110 /** Return the id of the tile at position x/y */
111 unsigned int gettileid(float x, float y);
113 void load_image(Surface** ptexture, std::string theme, const char * file, int use_alpha);
116 #endif /*SUPERTUX_LEVEL_H*/