diff options
-rwxr-xr-x | Maze.activity/activity.py | 28 | ||||
-rw-r--r-- | Maze.activity/activity/activity.info | 4 | ||||
-rw-r--r-- | Maze.activity/game.py | 7 | ||||
-rw-r--r-- | Maze.activity/icons/activity-easier.svg | 15 | ||||
-rw-r--r-- | Maze.activity/icons/activity-harder.svg | 16 | ||||
-rw-r--r-- | docs/NOTES.txt | 34 |
6 files changed, 37 insertions, 67 deletions
diff --git a/Maze.activity/activity.py b/Maze.activity/activity.py index 4b088c9..ceb205c 100755 --- a/Maze.activity/activity.py +++ b/Maze.activity/activity.py @@ -1,34 +1,6 @@ import olpcgames -import pygame -from sugar.graphics.toolbutton import ToolButton -from gettext import gettext as _ class MazeActivity(olpcgames.PyGameActivity): game_name = 'game' game_title = 'Maze' game_size = None # let olpcgames pick a nice size for us - - def build_toolbar( self ): - """Build our Activity toolbar for the Sugar system.""" - toolbar = super( MazeActivity, self ).build_toolbar() - - # Add buttons that will make the maze harder or easier - toolbar.harder = ToolButton('activity-harder') - toolbar.harder.set_tooltip(_('Harder')) - toolbar.harder.connect('clicked', self._harder_cb) - toolbar.insert(toolbar.harder, 2) - toolbar.harder.show() - - toolbar.easier = ToolButton('activity-easier') - toolbar.easier.set_tooltip(_('Easier')) - toolbar.easier.connect('clicked', self._easier_cb) - toolbar.insert(toolbar.easier, 2) - toolbar.easier.show() - - return toolbar - - def _harder_cb(self, button): - pygame.event.post(olpcgames.eventwrap.Event(pygame.USEREVENT, action='harder')) - - def _easier_cb(self, button): - pygame.event.post(olpcgames.eventwrap.Event(pygame.USEREVENT, action='easier')) diff --git a/Maze.activity/activity/activity.info b/Maze.activity/activity/activity.info index 7c4af02..96c105c 100644 --- a/Maze.activity/activity/activity.info +++ b/Maze.activity/activity/activity.info @@ -1,7 +1,9 @@ [Activity] name = Maze -service_name = vu.lux.olpc.Maze +bundle_id = vu.lux.olpc.Maze class = activity.MazeActivity icon = activity-maze activity_version = 6 show_launcher = yes +license = GPLv3+ +host_version = 1
\ No newline at end of file diff --git a/Maze.activity/game.py b/Maze.activity/game.py index 2ce497c..3d194fc 100644 --- a/Maze.activity/game.py +++ b/Maze.activity/game.py @@ -226,13 +226,6 @@ class MazeGame: print "Error handling message: %s\n%s" % (event, sys.exc_info()) else: print "Message from unknown buddy?" - elif event.type == pygame.USEREVENT: - if event.action == 'harder': - self.harder() - elif event.action == 'easier': - self.easier() - else: - print "Unknown user event action:", event.action else: print "Unknown event:", event diff --git a/Maze.activity/icons/activity-easier.svg b/Maze.activity/icons/activity-easier.svg deleted file mode 100644 index 5b1caef..0000000 --- a/Maze.activity/icons/activity-easier.svg +++ /dev/null @@ -1,15 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 14948) -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
- <!ENTITY fill_color "#FFFFFF">
- <!ENTITY stroke_color "#000000">
-]>
-<svg version="1.1" id="Layer_5" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
- width="74.5px" height="74px" viewBox="0 0 74.5 74" enable-background="new 0 0 74.5 74" xml:space="preserve">
-<g>
- <circle cx="37.026" cy="37.18" r="30" fill="&fill_color;"/>
- <g>
- <line fill="none" stroke="&stroke_color;" stroke-width="4" x1="55.026" y1="37.18" x2="19.026" y2="37.18"/>
- </g>
-</g>
-</svg>
diff --git a/Maze.activity/icons/activity-harder.svg b/Maze.activity/icons/activity-harder.svg deleted file mode 100644 index e1fc560..0000000 --- a/Maze.activity/icons/activity-harder.svg +++ /dev/null @@ -1,16 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 14948) -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
- <!ENTITY fill_color "#FFFFFF">
- <!ENTITY stroke_color "#000000">
-]>
-<svg version="1.1" id="Layer_5" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
- width="74.5px" height="74px" viewBox="0 0 74.5 74" enable-background="new 0 0 74.5 74" xml:space="preserve">
-<g>
- <circle cx="37.026" cy="37.18" r="30" fill="&fill_color;"/>
- <g>
- <line fill="none" stroke="&stroke_color;" stroke-width="4" x1="37.026" y1="19.18" x2="37.026" y2="55.18"/>
- <line fill="none" stroke="&stroke_color;" stroke-width="4" x1="55.026" y1="37.18" x2="19.026" y2="37.18"/>
- </g>
-</g>
-</svg>
diff --git a/docs/NOTES.txt b/docs/NOTES.txt index d7389bf..3968fd4 100644 --- a/docs/NOTES.txt +++ b/docs/NOTES.txt @@ -40,6 +40,40 @@ Enhancements: Add multiple floors with ramps, ladders, pits, etc. Add a light source at each player that reveals the map as you travel through it. Add a fog that slowly fades areas you have seen already. + + +Amazing Mazes: + Implement some algorithms from here: + http://www.astrolog.org/labyrnth/algrithm.htm + + Currently (Maze v5) we use the Recursive backtracker algorithm. + It would be nice to switch to "Growing tree algorithm" which would allow + a simple adjustment to affect the river of the maze. It could also have + a directional bias adjustment that controls the probability of digging + horizontally versus vertically. + + After implementing this, it seems that there are two adjustments that + make a difference to the maze. One is the probability of continuing the + current path versus going back to the stack of old cells. The other is + the probability of picking a new versus old cell. If you always pick very + old cells the maze is very odd looking and boring. If you always continue + the current path or pick a recent cell then the maze is just like before. + If you sometimes pick a cell mostly at random, then the maze has many short + paths, but the solution is relatively direct and easy to find. I was not + able to find a combination of settings that makes the maze much more difficult + than before. Perhaps picking a mostly new path, but not always the current + path is slightly more difficult. + + If I had to pick just one knob, then I would pick the % chance of continuing the + current path, with a fixed uniform probability of picking any path on the stack. + This gives a variety in the maze texture without ever getting a bizarre looking + maze. + + For some complex mazes, would need to switch to an image-based map or an + adjacency-graph-based map. + Could use the mouse to move (move in small steps towards mouse - no clicking) + + Ideally you could just import any image and use it as a maze. |