Hi,
I am trying to make a grid based game. I have a 100x100 grid, where i can control my player to move across one slot using key.
The player movement is working well and I can move across the grid ONE FRAME AT A TIME.
The main problem is with AI player movement. I am using A* algorithm to get the path for the AI component. What i am doing at present is:
1) I give the AI player position and the goal position to the A* algorithm and generate the path. ( this calculation is Inside the game Update function )
The output of the A* algorithm is a string which gives the grid locations.
2) Then inside the draw function when I use a for loop to draw for each grid location, the AI player reaches the goal in split of a second..just within one frame
what i want is that the ai player should move slowly towards the goal ...so that there is a perfect competition between the user and ai to reach the goal.
How to control the movement of AI player so that its playable enough?
?
All suggestions are welcome......