.
This commit is contained in:
ddamiankowalski 2022-04-08 00:27:18 +02:00
parent 2dadd020c6
commit aee0fcf2f5

14
board
View File

@ -231,24 +231,26 @@ if __name__ == '__main__':
if currentNode.xPos != parentNode.xPos: if currentNode.xPos != parentNode.xPos:
if currentNode.xPos > parentNode.xPos: if currentNode.xPos > parentNode.xPos:
direction = "E" direction = "EAST"
objectArray[0].xPos = objectArray[0].xPos + 1 objectArray[0].xPos = objectArray[0].xPos + 1
else: else:
direction = "W" direction = "WEST"
objectArray[0].xPos = objectArray[0].xPos - 1 objectArray[0].xPos = objectArray[0].xPos - 1
else: else:
if currentNode.yPos > parentNode.yPos: if currentNode.yPos > parentNode.yPos:
direction = "S" direction = "SOUTH"
objectArray[0].yPos = objectArray[0].yPos + 1 objectArray[0].yPos = objectArray[0].yPos + 1
else: else:
direction = "N" direction = "NORTH"
objectArray[0].yPos = objectArray[0].yPos - 1 objectArray[0].yPos = objectArray[0].yPos - 1
time.sleep(1) time.sleep(1)
print("NEXT DIRECTION: " + direction) print("ACTION: TURN TO " + direction)
### OPIDSZ TUTAJ
draw(15, objectArray, pathToTarget, 1) draw(15, objectArray, pathToTarget, 1)
pygame.display.update() pygame.display.update()
print(index)
drawFull(index) drawFull(index)
time.sleep(5)
quit() quit()