diff options
author | Gonzalo Odiard <godiard@gmail.com> | 2014-06-23 18:50:26 (GMT) |
---|---|---|
committer | Gonzalo Odiard <godiard@gmail.com> | 2014-06-23 19:57:12 (GMT) |
commit | a8ab7cfbc76b57cd3e70caee772e4b2b0277ee6e (patch) | |
tree | f9437014753aaa59e6c1af2c0e0e36571ecaf228 | |
parent | 9977d8ec28d47a3c18808e3e97d72769a36c64aa (diff) |
Set minimal and max maze complexity limits
-rw-r--r-- | game.py | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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 |