Skip to content

Commit

Permalink
Lowered player speed to improve wall collision accuracy changed wall …
Browse files Browse the repository at this point in the history
…collision specs (still needs adjusting)
  • Loading branch information
1024Adam committed Mar 15, 2017
1 parent 35c6659 commit dd0a4cf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions infinite_maze/Player.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class Player:
def __init__(self, xPosition, yPosition):
self.cursor = pygame.image.load('img/player.png')
self.position = (xPosition, yPosition)
self.speed = 10
self.speed = 5

def setX(self, xPosition):
self.position = (xPosition, self.position[1])
Expand Down Expand Up @@ -37,4 +37,4 @@ def getCursor(self):
def reset(self, xPosition, yPosition):
self.setX(xPosition)
self.setY(yPosition)
self.speed = 10
self.speed = 5
10 changes: 5 additions & 5 deletions infinite_maze/infinite_maze.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,26 @@ def maze():
for line in lines:
if ((player.getX() + player.getSpeed() >= line.getXStart()) and (player.getX() <= line.getXStart()) and (player.getY() + 6 >= line.getYStart()) and (player.getY() - 6 <= line.getYStart())):
blocked = 1
if ((player.getX() + 5 + player.getSpeed() >= line.getXStart()) and (player.getX() <= line.getXStart()) and (player.getY() >= line.getYStart()) and (player.getY() <= line.getYEnd())):
if ((player.getX() + 6 + player.getSpeed() >= line.getXStart()) and (player.getX() <= line.getXStart()) and (player.getY() >= line.getYStart()) and (player.getY() <= line.getYEnd())):
blocked = 1
if (not blocked):
player.moveX(1)
game.updateScore(1)
if (keys[pygame.K_DOWN] or keys[pygame.K_s]):
blocked = 0
for line in lines:
if ((player.getY() + player.getSpeed() >= line.getYStart()) and (player.getY() <= line.getYStart()) and (player.getX() + 6 > line.getXStart()) and (player.getX() - 6 < line.getXStart())):
if ((player.getY() + 5 + player.getSpeed() >= line.getYStart()) and (player.getY() <= line.getYStart()) and (player.getX() + 6 > line.getXStart()) and (player.getX() - 6 < line.getXStart())):
blocked = 1
if ((player.getY() + 8 + player.getSpeed() >= line.getYStart()) and (player.getY() <= line.getYStart()) and (player.getX() >= line.getXStart()) and (player.getX() <= line.getXEnd())):
if ((player.getY() + 6 + player.getSpeed() >= line.getYStart()) and (player.getY() <= line.getYStart()) and (player.getX() >= line.getXStart()) and (player.getX() <= line.getXEnd())):
blocked = 1
if (not blocked):
player.moveY(1)
if (keys[pygame.K_UP] or keys[pygame.K_w]):
blocked = 0
for line in lines:
if ((player.getY() - player.getSpeed() <= line.getYEnd()) and (player.getY() >= line.getYEnd()) and (player.getX() + 5 > line.getXStart()) and (player.getX() - 5 < line.getXStart())):
if ((player.getY() - player.getSpeed() <= line.getYEnd()) and (player.getY() >= line.getYEnd()) and (player.getX() + 6 > line.getXStart()) and (player.getX() - 6 < line.getXStart())):
blocked = 1
if ((player.getY() - 8 - player.getSpeed() <= line.getYEnd()) and (player.getY() >= line.getYEnd()) and (player.getX() >= line.getXStart()) and (player.getX() <= line.getXEnd())):
if ((player.getY() - 6 - player.getSpeed() <= line.getYEnd()) and (player.getY() >= line.getYEnd()) and (player.getX() >= line.getXStart()) and (player.getX() <= line.getXEnd())):
blocked = 1
if (not blocked):
player.moveY(-1)
Expand Down

0 comments on commit dd0a4cf

Please sign in to comment.