for event in pygame.event.get(): if event.type == pygame.QUIT: pygame.quit sys.exit()
if event.type == pygame.KEYDOWN: if event.key == pygame.K_LEFT: playerx -= 5
if event.key == pygame.K_RIGHT: playerx += 5
if event.type == pygame.KEYUP: if event.key == K_LEFT: playerx = 0
if event.key == K_RIGHT: playerx = 0
player(playerx, playery) clock.tick(60) pygame.display.update() [/code] В коде Vidstudio, когда я пытаюсь переместить проигрывателя, он перемещается, но сразу после этого возвращается в исходное положение.
I'm making a 2d top-down game in Godot 4 with C# and I can't get the enemy AI to move toward the player. The only time it follows the player is when the player in under the enemy and touching the enemy.