Skip to content

Commit

Permalink
Border printing around maze (not part of maze lines)
Browse files Browse the repository at this point in the history
  • Loading branch information
1024Adam committed Mar 11, 2017
1 parent e12f5b2 commit 7dd0e29
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion infinite_maze/Game.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,12 @@ def updateScreen(self, player, lines):
if ((self.clock.getSecs() == 10 and self.clock.getSecs() != prevClock) or (self.clock.getFullTime() > 1000 and self.clock.getSecs() % 30 == 0 and self.clock.getSecs() != prevClock)):
self.pace += 1

# Print Display Text
# Print Border
pygame.draw.line(self.getScreen(), self.fgColor, (self.xMin, self.yMin), (self.width, self.yMin), 1)
pygame.draw.line(self.getScreen(), self.fgColor, (self.xMin, self.yMax + 15), (self.width, self.yMax + 15), 1)
pygame.draw.line(self.getScreen(), self.fgColor, (80, self.yMin), (80, self.yMax + 15), 2)

# Print Display Text
timeText = self.font.render('Time: ' + self.clock.getTimeString(), 1, self.fgColor)
self.screen.blit(timeText, (10, 10))
scoreText = self.font.render('Score: ' + str(self.score), 1, self.fgColor)
Expand Down
5 changes: 4 additions & 1 deletion infinite_maze/Line.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,14 @@ def setYEnd(self, newY):
@staticmethod
def generateMaze(game, width, height):
lines = []
#side = 0
# Horizontal Line Gen
for x in range(width):
xPos = (22 * x) + game.getXMax()
for y in range(height):
for y in range(1, height - 1):
yPos = (22 * y) + game.getYMin()
lines.append(Line((xPos, yPos), (xPos + 22, yPos), 0, 0))
# Vertical Line Gen
for y in range(height - 1):
yPos = (22 * y) + game.getYMin()
for x in range(1, width):
Expand Down

0 comments on commit 7dd0e29

Please sign in to comment.