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

16
board
View File

@ -159,7 +159,7 @@ def drawFull(index):
green = (0, 255, 0)
pygame.draw.circle(screen, green, ((node.xPos + 1)
* 500 / 15 + 30, (node.yPos + 1) * 500 / 15), 5)
draw(15, objectArray, pathToTarget, 1)
draw(15, objectArray, pathToTarget, 1)
for node in fields:
if node.isBlock == True:
@ -231,24 +231,26 @@ if __name__ == '__main__':
if currentNode.xPos != parentNode.xPos:
if currentNode.xPos > parentNode.xPos:
direction = "E"
direction = "EAST"
objectArray[0].xPos = objectArray[0].xPos + 1
else:
direction = "W"
direction = "WEST"
objectArray[0].xPos = objectArray[0].xPos - 1
else:
if currentNode.yPos > parentNode.yPos:
direction = "S"
direction = "SOUTH"
objectArray[0].yPos = objectArray[0].yPos + 1
else:
direction = "N"
direction = "NORTH"
objectArray[0].yPos = objectArray[0].yPos - 1
time.sleep(1)
print("NEXT DIRECTION: " + direction)
print("ACTION: TURN TO " + direction)
### OPIDSZ TUTAJ
draw(15, objectArray, pathToTarget, 1)
pygame.display.update()
print(index)
drawFull(index)
time.sleep(5)
quit()