diff options
author | Dpk3062 <dpk3062@rit.edu> | 2009-06-28 00:37:01 (GMT) |
---|---|---|
committer | Dpk3062 <dpk3062@rit.edu> | 2009-06-28 00:37:01 (GMT) |
commit | 0b510198ed9b010363d1f8ef82ce1f30df780109 (patch) | |
tree | 846084051fa0b4f677f3ea4ad00bb26b4a2084bb | |
parent | eeabb679006b687b62b54eae0ff18969cb3e3984 (diff) |
* LevelInfo objects created for all configured mlvl files
* No error checking
-rw-r--r-- | docs/web/SugarLab ProjectWiki Page.txt | 64 | ||||
-rw-r--r-- | src/actions/__init__.py | 0 | ||||
-rw-r--r-- | src/actions/action.py | 35 | ||||
-rw-r--r-- | src/setup/__init__.py | 0 | ||||
-rw-r--r-- | src/setup/level.py | 31 | ||||
-rw-r--r-- | src/setup/main.py | 61 |
6 files changed, 191 insertions, 0 deletions
diff --git a/docs/web/SugarLab ProjectWiki Page.txt b/docs/web/SugarLab ProjectWiki Page.txt new file mode 100644 index 0000000..faa200c --- /dev/null +++ b/docs/web/SugarLab ProjectWiki Page.txt @@ -0,0 +1,64 @@ +=Muthris= +Muthris is a math themed, Tetris-based game inspired by Cuyo. Players control falling blocks which must be grouped in certain ways in-order to clear that grouping from the board. For more details, see the project's Vision and Scope document contained in its Sugar Labs' Gitorious repository (once the repository is working...). +==Updates as of April 29th, 2009== +* Updated Wiki page +* Falling back to a local Git repository to prevent further delays +* Working on flow charts +* Working on file formats +==Developers== +*[[User:Dpk3062|Douglas Krofcheck]] +==Goals== +* To be fun to play +* To teach mathematical concepts +* To be discrete in its teachings +* To follow good software engineering practices during development +==Schedule and Tasks== +* By May 1st, 2009 +** Have completed most important flow charts +** Developers completed the Python tutorials +* By May 8th, 2009 +** Have completed architecture documentation +** Developers completed the PyGame tutorials +* By May 15th, 2009 +** Determine test plans +** Review design documents +** Start coding of system skeleton +* By May 22nd, 2009 +** Determine future development plans +==Overall Plan== +===Must Have=== +* Project Documentation +** Vision and Scope +** Architecture docs +** Flow Charts +* Working code repository +* Project schedule +* At least one developer +* Text-based version of the game +* Readme +===Should Have=== +* Skeleton - working, stubbed framework before general coding +* Installation tutorial +* Program walk-through +* GUI version of the game +* Build tutorial +* Project backup +===Nice to Have=== +* Unit tests +* SRS Document +* Release 1 +* No major project risks +==Major Project Risks== +* Git repository not currently working for any developers +* Developers do not know Python or PyGame well +* Developmental time constraints +* Short overall time frame +==Other Info== +===Potential Contacts=== +*[[User:Dpk3062|Douglas Krofcheck]] +===Links and Resources=== +*[http://git.sugarlabs.org/projects/muthris Project Repository] - (committing not yet working) +*[http://www.openoffice.org/ OpenOffice.org] - to read documentation files (.odt) +*[http://live.gnome.org/Dia Dia] - To view flow charts (.dia) +===Initial Math4OLPC Educational Target=== +* 4.N.7 - Recognize classes (in particular, odds, evens; factors or multiples of a given number; and squares) to which a number may belong, and identify the numbers in those classes. Use these in the solution of problems diff --git a/src/actions/__init__.py b/src/actions/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/actions/__init__.py diff --git a/src/actions/action.py b/src/actions/action.py new file mode 100644 index 0000000..38ae9a0 --- /dev/null +++ b/src/actions/action.py @@ -0,0 +1,35 @@ +''' + +''' + +class Actions(object): + '''Actions are created by the player or the system and are sent around as messages between different components''' + + def pack(self, action): + '''Packages the given object for transmission over a network''' + #TODO + pass + + def unpack(self, package): + '''Unpackages the given network package into its original Action''' + #TODO + pass + + +class UserActions(Actions): + '''UserActions are Actions performed by the player''' + + def isLegal(self, model): + '''Returns true if this action is able to perform itself on the given game board data''' + #TODO + pass + + def apply(self, model): + '''Causes this UserAction to perform itself on the given game board data''' + #TODO + pass + + +class SystemActions(Actions): + '''SystemActions are Actions created only by different components of the game''' + pass diff --git a/src/setup/__init__.py b/src/setup/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/setup/__init__.py diff --git a/src/setup/level.py b/src/setup/level.py new file mode 100644 index 0000000..907d8bd --- /dev/null +++ b/src/setup/level.py @@ -0,0 +1,31 @@ +''' + +''' +from lxml import etree +from utils import utils + +class LevelInfo(object): + ''' + ''' + + def __init__(self, path): + ''' + Constructor + ''' + + #open up the mlvl file and read in its basic properties + root = utils.getXMLRoot(path) + self.name = root.xpath('//level-info/@name')[0] + self.description = root.xpath('//level-info/@description')[0] + pass + + def getName(self): + '''Gets the name of this level''' + return self.name + + def getDescription(self): + '''Gets the description of this level''' + return self.description + + +
\ No newline at end of file diff --git a/src/setup/main.py b/src/setup/main.py new file mode 100644 index 0000000..1f05f10 --- /dev/null +++ b/src/setup/main.py @@ -0,0 +1,61 @@ +''' + +''' + +if __name__ == '__main__': + pass + +import os + +# using lxml for XML processing +from lxml import etree +from level import LevelInfo +from utils import utils + +# constants +ConfigFile = '/home/doug/workspace/Muthris/docs/examples/config.xml' +LevelExt = '.mlvl' + +# load the configuration file +config = utils.getXMLRoot(ConfigFile) + +#for each level folder, scan for and process any Muthris level files (.mlvl) +levels = [] +folders = config.xpath('//level-folders/folder/@location') +for folder in folders: + #search for files in the level folder + list = os.listdir(folder) + print(list) + for path in list: + #make sure path is not just the filename, as isfile() would fail if it was + path = folder + '/' + path + + #only want level files + if not os.path.isfile(path): + continue + if not path.endswith(LevelExt): + continue + + #create a level object for this level file + level = LevelInfo( path ) + levels.append( level ) + +print( config ) +print( folders ) + + + +# find all the level folders + +# load all the level folders + +# start the menus + +print( 'done' ) + + +def processLevelFile( file ): + ''' ''' + pass + + |