itch.io is community of indie game creators and players

AI Movement

Posted: 11/24/2023

The Problem:

The problem I am having is while in the combat level the AI enemy is not moving to the player. when the player ends his turn the AI finds a path to the player and then is supposed to move towards the player. The AI not moving is a problem because the enemy will never be able to attack the player because it will never be in range.

The Solution:

I am still working on a solution, the path the enemy is supposed to take is stored in an array, I am looping through the array and passing in the location of each object along the path to a simple move to function. I am not sure why the enemy is not moving, I have verified the path is being stored and that each iteration of the loop is moving to the next index and passing the next location to the move function.

Leave a comment