diff options
author | Nguyễn Gia Phong <vn.mcsinyx@gmail.com> | 2018-03-06 09:58:52 +0700 |
---|---|---|
committer | Nguyễn Gia Phong <vn.mcsinyx@gmail.com> | 2018-03-06 09:58:52 +0700 |
commit | f7c600934e1406fe0d18ce69a948c3622af84d36 (patch) | |
tree | 913a3d552fefed9da40eecb458131c713c079510 | |
parent | 2bafc0c75ac5f9c42593c4905f12bfda66afad1b (diff) | |
download | brutalmaze-f7c600934e1406fe0d18ce69a948c3622af84d36.tar.gz |
Test and fix minor bugs
-rw-r--r-- | brutalmaze/game.py | 5 | ||||
-rw-r--r-- | brutalmaze/maze.py | 4 | ||||
m--------- | wiki | 0 |
3 files changed, 5 insertions, 4 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 -Subproject c1138583e40e11bf1acd473b83ea98b81caac19 +Subproject 7d455d5a9e1933963a86ea475008582ec961c22 |