# HG changeset patch # User Simon Cross # Date 1316303505 -7200 # Node ID 13d02d1f5ae04b8c23a41e5aabdabc46e296cd2c # Parent 8604b8d660f6ee9707682e5f738f108b2a2376d7 Add help to editor. diff -r 8604b8d660f6 -r 13d02d1f5ae0 mamba/habitats/editor.py --- a/mamba/habitats/editor.py Sun Sep 18 01:45:57 2011 +0200 +++ b/mamba/habitats/editor.py Sun Sep 18 01:51:45 2011 +0200 @@ -29,6 +29,31 @@ 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 3 modes: placing tiles, placing things and editing sprites. + +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. + +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.""") + class EditorHabitat(Habitat): def __init__(self, level): @@ -224,7 +249,9 @@ return True def show_help(self, ev, widget): - print "Help!" + message = MessageBox((50, 50), HELP_MSG, color="black", + fontsize=12) + self.display_dialog(message) return True def go_mainmenu(self, ev, widget): @@ -253,7 +280,7 @@ message = self.check_level() if message: self.display_dialog(message) - return + return True self.level.save_level('user_levels', is_user_dir=True) self.refresh_display() message = MessageBox((300, 300),