C
C#10mo ago
TOLOXI

Enemy following after the player (MONOGAME)

Im making a simple game using Monogame in visual studio. I have two sprites drawn on the screen (pink is the player) (purple is the enemy) i want the enemy to follow after the player. whats the most efficent and easiet way to make it?
No description
2 Replies
TOLOXI
TOLOXIOP10mo ago
blackSheep
blackSheep10mo ago
You could create a A* (path finding Algorithm) to the enemy so uses his location as a start point then check the location of the player for the end point. The A* would cauculate the best path from enemy to player, then the enemy uses the path to move towards the player. I'm assuming you have a grid system (x, y) to place thing on your screen.
Want results from more Discord servers?
Add your server