add agent rotate image

This commit is contained in:
Darek Golomski 2021-04-09 18:47:12 +02:00
parent 3d8ff6222c
commit 1900954708
5 changed files with 3 additions and 3 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -25,7 +25,7 @@ def main():
#1 - right
#2 - up
#3 - left
#4 - down
#0 - down
while running:
for event in pg.event.get():
@ -34,9 +34,9 @@ def main():
running = False
elif event.type == pg.KEYDOWN:
if (event.key == pg.K_d or event.key == pg.K_RIGHT):
game_ui.rotate(1)
elif (event.key == pg.K_a or event.key == pg.K_LEFT):
game_ui.rotate(-1)
elif (event.key == pg.K_a or event.key == pg.K_LEFT):
game_ui.rotate(1)
elif (event.key == pg.K_w or event.key == pg.K_UP and ((agent.dir == 1 and agent.x*80 < 700) or (agent.dir == 3 and agent.x*80 > 5) or
(agent.dir == 2 and agent.y*80 > 0) or (agent.dir == 0 and agent.y*80 < 700))):
game_ui.move()