# HG changeset patch # User Neil Muller # Date 1316705924 -7200 # Node ID fda360905a1e798b136e46ae6544415d68303b06 # Parent 30a5ded79313cba444347669d5d35036296dca8c Move help text out into a seperate file diff -r 30a5ded79313 -r fda360905a1e data/editor_help.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/editor_help.txt Thu Sep 22 17:38:44 2011 +0200 @@ -0,0 +1,24 @@ +Levels are saved as user levels, and stored in $XDG_DATA_HOME/.mamba/user_levels (i.e. +~/.local/share/.mamba/user_levels) or $APPDATA/.mamba/user_levels on Windows. + +A new level can be created from one of the existing templates using "New". Level properties, such as the +name, filename and background music track can be changed using the "Edit Level Metadata" button. + +The level editor has 4 modes: placing tiles, placing things, editing sprites and testing the level. + +Tiles are level geography, such as floors, walls and so forth. Things are items that the snake can eat, such as rats. +Sprites are special elements with more complex items which require extra configuration information, such as tunnels. + +To place tiles and things, select the desired element and click on the map to place the tile or thing. Deleting anything +replaces the space with a floor tile (Right click also deletes). The selection of tiles can be scrolled using the arrow buttons. + +Sprites can be placed as well. Sprites require parameters. Each sprite needs a unique id tag, which can be any string +without spaces, and then additional parameters that depend on the type of sprite, usually the id of another sprite. +Sprites can be added, edited and deleted. Look at existing maps to see how the parameters can be used. + +Test mode allows you to test the level without any clock running. The snake is moved using the cursor keys, or by pressing +space, but interacts with the level as in the actual game. Space will advance the snake one step, useful for testing arrows. +Replays can be stored of progress on a run to date, which is useful for debugging levels. + +Levels can be saved, and uploaded to be shared with other people. Shared levels +only become available after the levels have been curated by the Mamba team. diff -r 30a5ded79313 -r fda360905a1e mamba/habitats/editor.py --- a/mamba/habitats/editor.py Thu Sep 22 17:37:16 2011 +0200 +++ b/mamba/habitats/editor.py Thu Sep 22 17:38:44 2011 +0200 @@ -30,32 +30,7 @@ MAX_TOOLS = 6 MODE_HEIGHT = 370 LOAD_SAVE_HEIGHT = 500 - -# hghooks: no-pep8 -HELP_MSG = ( -"""Levels are saved as user levels, and stored in $XDG_DATA_HOME/.mamba/user_levels (i.e. -~/.local/share/.mamba/user_levels) or $APPDATA/.mamba/user_levels on Windows. - -A new level can be created from one of the existing templates using "New". Level properties, such as the -name, filename and background music track can be changed using the "Edit Level Metadata" button. - -The level editor has 4 modes: placing tiles, placing things, editing sprites and testing the level. - -Tiles are level geography, such as floors, walls and so forth. Things are items that the snake can eat, such as rats. -Sprites are special elements with more complex items which require extra configuration information, such as tunnels. - -To place tiles and things, select the desired element and click on the map to place the tile or thing. Deleting anything -replaces the space with a floor tile (Right click also deletes). The selection of tiles can be scrolled using the arrow buttons. - -Sprites can be placed as well. Sprites require parameters. Each sprite needs a unique id tag, which can be any string -without spaces, and then additional parameters that depend on the type of sprite, usually the id of another sprite. -Sprites can be added, edited and deleted. Look at existing maps to see how the parameters can be used. - -Test mode allows you to test the level without any clock running. The snake is moved using the cursor keys, or by pressing -space, but interacts with the level as in the actual game. Space will advance the snake one step, useful for testing arrows. - -Levels can be saved, and uploaded to be shared with other people. Shared levels -only become available after the levels have been curated by the Mamba team.""") +HELP = 'editor_help.txt' class EditorHabitat(Habitat): @@ -82,6 +57,8 @@ K_RIGHT: RIGHT, K_SPACE: None, } + helpfile = load_file(HELP) + self.help_msg = ''.join(helpfile.readlines()) def on_enter(self): # We need to juggle the display to the correct size @@ -311,7 +288,7 @@ return True def show_help(self, ev, widget): - message = MessageBox((20, 20), HELP_MSG, color="black", + message = MessageBox((20, 20), self.help_msg, color="black", fontsize=12) self.display_dialog(message) return True