From f7c600934e1406fe0d18ce69a948c3622af84d36 Mon Sep 17 00:00:00 2001 From: Nguyễn Gia Phong Date: Tue, 6 Mar 2018 09:58:52 +0700 Subject: Test and fix minor bugs --- brutalmaze/game.py | 5 +++-- brutalmaze/maze.py | 4 ++-- wiki | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/brutalmaze/game.py b/brutalmaze/game.py index a9e3d82..963b55c 100644 --- a/brutalmaze/game.py +++ b/brutalmaze/game.py @@ -212,8 +212,9 @@ class Game: self.fps -= 1 elif self.fps < self.max_fps and not self.paused: self.fps += 5 - if not self.paused: self.maze.update(self.fps) - if not self.headless: self.maze.draw() + if not self.paused: + self.maze.update(self.fps) + if not self.headless: self.maze.draw() self.clock.tick(self.fps) return True diff --git a/brutalmaze/maze.py b/brutalmaze/maze.py index aeaec06..b25662e 100644 --- a/brutalmaze/maze.py +++ b/brutalmaze/maze.py @@ -93,7 +93,7 @@ class Maze: self.distance = (self.w * self.h / 416) ** 0.5 self.x, self.y = self.w // 2, self.h // 2 self.centerx, self.centery = self.w / 2.0, self.h / 2.0 - w, h = (int(i/self.distance/2 + 2) for i in size) + w, h = (int(i/self.distance/2 + 1) for i in size) self.rangex = list(range(MIDDLE - w, MIDDLE + w + 1)) self.rangey = list(range(MIDDLE - h, MIDDLE + h + 1)) self.score = INIT_SCORE @@ -342,7 +342,7 @@ class Maze: self.x, self.y = self.w // 2, self.h // 2 self.centerx = self.x + offsetx*self.distance self.centery = self.y + offsety*self.distance - w, h = int(self.w/self.distance/2 + 2), int(self.h/self.distance/2 + 2) + w, h = int(self.w/self.distance/2 + 1), int(self.h/self.distance/2 + 1) self.rangex = list(range(MIDDLE - w, MIDDLE + w + 1)) self.rangey = list(range(MIDDLE - h, MIDDLE + h + 1)) self.slashd = self.hero.R + self.distance/SQRT2 diff --git a/wiki b/wiki index c113858..7d455d5 160000 --- a/wiki +++ b/wiki @@ -1 +1 @@ -Subproject commit c1138583e40e11bf1acd473b83ea98b81caac191 +Subproject commit 7d455d5a9e1933963a86ea475008582ec961c22d -- cgit 1.4.1