Test and fix minor bugs

This commit is contained in:
Nguyễn Gia Phong 2018-03-06 09:58:52 +07:00
parent 2bafc0c75a
commit f7c600934e
3 changed files with 6 additions and 5 deletions

View File

@ -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

View File

@ -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

2
wiki

@ -1 +1 @@
Subproject commit c1138583e40e11bf1acd473b83ea98b81caac191
Subproject commit 7d455d5a9e1933963a86ea475008582ec961c22d