Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGonzalo Odiard <godiard@gmail.com>2014-06-23 18:50:26 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2014-06-23 19:57:12 (GMT)
commita8ab7cfbc76b57cd3e70caee772e4b2b0277ee6e (patch)
treef9437014753aaa59e6c1af2c0e0e36571ecaf228
parent9977d8ec28d47a3c18808e3e97d72769a36c64aa (diff)
Set minimal and max maze complexity limits
-rw-r--r--game.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/game.py b/game.py
index 8ad090e..b882a28 100644
--- a/game.py
+++ b/game.py
@@ -605,6 +605,8 @@ class MazeGame(Gtk.DrawingArea):
"""Make a new maze that is harder than the current one."""
# both width and height must be odd
newHeight = self.maze.height + 2
+ if newHeight > 125:
+ newHeight = 125
newWidth = int(newHeight * self.aspectRatio)
if newWidth % 2 == 0:
newWidth -= 1
@@ -623,6 +625,8 @@ class MazeGame(Gtk.DrawingArea):
"""Make a new maze that is easier than the current one."""
# both width and height must be odd
newHeight = max(self.maze.height - 2, 5)
+ if newHeight < 9:
+ newHeight = 9
newWidth = int(newHeight * self.aspectRatio)
if newWidth % 2 == 0:
newWidth -= 1