diff options
author | Dpk3062 <dpk3062@rit.edu> | 2009-07-06 03:44:05 (GMT) |
---|---|---|
committer | Dpk3062 <dpk3062@rit.edu> | 2009-07-06 03:44:05 (GMT) |
commit | be5f99eca2a2d42552605a1e9fb34063734903ba (patch) | |
tree | 8e4b27badc4b117fe9be3a1858ec799b85e60b70 | |
parent | eeabb679006b687b62b54eae0ff18969cb3e3984 (diff) |
* Shortened some XML tags
* Renamed profile.xml to profile.mpro
* Added /muthris/config/last/profile
-rw-r--r-- | docs/examples/config.xml | 10 | ||||
-rw-r--r-- | docs/examples/lvl-1.mlvl | 4 | ||||
-rw-r--r-- | docs/examples/profile.mpro (renamed from docs/examples/profile.xml) | 0 | ||||
-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 |
9 files changed, 203 insertions, 2 deletions
diff --git a/docs/examples/config.xml b/docs/examples/config.xml index 7198e37..7867322 100644 --- a/docs/examples/config.xml +++ b/docs/examples/config.xml @@ -7,6 +7,16 @@ </level-folders> <!-- --> + <profile-folders> + <folder location='/home/doug/workspace/Muthris/docs/examples'/> + </profile-folders> + + <!-- Things that were last used/inputed --> + <last> + <profile name='dpk3062'/> + </last> + + <!-- --> <settings> </settings> diff --git a/docs/examples/lvl-1.mlvl b/docs/examples/lvl-1.mlvl index 755d600..51eed41 100644 --- a/docs/examples/lvl-1.mlvl +++ b/docs/examples/lvl-1.mlvl @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <muthris> - <level-info name='Demo Level 1' description='The first demo level' version='1'> + <level name='Demo Level 1' description='The first demo level' version='1'> <!-- TODO Need to figure out how localization fits in with all the raw text --> @@ -81,6 +81,6 @@ <block script='dl1/PrimeBlock.py'/> </blocks> - </level-info> + </level> </muthris> diff --git a/docs/examples/profile.xml b/docs/examples/profile.mpro index 053c75e..053c75e 100644 --- a/docs/examples/profile.xml +++ b/docs/examples/profile.mpro 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 + + |