Home | Trees | Index | Help |
---|
|
Game
object records the state of the player's avatar and of every level that
the player has explored. In order to reduce memory usage, it maintains
some of this state on disk: a single file is used for each level that the
player visits, and only a few levels are kept in memory at a given
time.
Method Summary | |
---|---|
__init__(self,
playdir,
current_level)
| |
Return the level with the given name. | |
Load a game from the subdirectory of 'data/saves' with the given name. (Static method) | |
Save this game to a subdirectory of the 'data/saves' directory with the given name. |
Instance Variable Summary | |
---|---|
current_level : The name of the current level. |
Class Variable Summary | |
---|---|
int |
CACHE_SIZE = 3 |
Instance Method Details |
---|
__init__(self,
playdir='play',
current_level=None)
|
level(self, levelname=None, update_current_level=True)Return the level with the given name. If the level is present in memory or on disk, then it will be returned from there; otherwise, it is returned from the 'data/levels' directory.
|
save(self, savename)Save this game to a subdirectory of the 'data/saves' directory with the given name. Each level will be saved in a separate file, and an additional file will be created that contains the name of the current level. |
Static Method Details |
---|
load(savename, playdir='play')Load a game from the subdirectory of 'data/saves' with the given name. |
Instance Variable Details |
---|
current_levelThe name of the current level. |
Class Variable Details |
---|
CACHE_SIZE
|
Home | Trees | Index | Help |
---|
Generated by Epydoc 2.1 on Thu Sep 22 22:52:44 2005 | http://epydoc.sf.net |