From a8ab7cfbc76b57cd3e70caee772e4b2b0277ee6e Mon Sep 17 00:00:00 2001 From: Gonzalo Odiard Date: Mon, 23 Jun 2014 18:50:26 +0000 Subject: Set minimal and max maze complexity limits --- 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 -- cgit v0.9.1