Wózek się rusza
This commit is contained in:
parent
9fcded9ddc
commit
b7b8be4863
13
wozek.py
13
wozek.py
@ -292,6 +292,7 @@ def game_loop():
|
|||||||
path.reverse()
|
path.reverse()
|
||||||
for node in path:
|
for node in path:
|
||||||
print(node.action)
|
print(node.action)
|
||||||
|
i=0
|
||||||
running = True
|
running = True
|
||||||
while running:
|
while running:
|
||||||
for event in pygame.event.get():
|
for event in pygame.event.get():
|
||||||
@ -317,6 +318,18 @@ def game_loop():
|
|||||||
draw_forklift_and_freight()
|
draw_forklift_and_freight()
|
||||||
pygame.display.flip()
|
pygame.display.flip()
|
||||||
clock.tick(FPS)
|
clock.tick(FPS)
|
||||||
|
if(i<len(path)):
|
||||||
|
nod=path[i]
|
||||||
|
if(nod.action=='FW'):
|
||||||
|
move_forklift()
|
||||||
|
elif(nod.action=='L'):
|
||||||
|
rotate_forklift('L')
|
||||||
|
load_images()
|
||||||
|
elif(nod.action=='R'):
|
||||||
|
rotate_forklift('R')
|
||||||
|
load_images()
|
||||||
|
i=i+1
|
||||||
|
pygame.time.wait(500)
|
||||||
|
|
||||||
pygame.quit()
|
pygame.quit()
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
Loading…
Reference in New Issue
Block a user