.
.
This commit is contained in:
parent
2dadd020c6
commit
aee0fcf2f5
16
board
16
board
@ -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()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user