Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: Yeong on May 03, 2012, 10:59:46 pm

Title: Fire Emblem style enemy AI help
Post by: Yeong on May 03, 2012, 10:59:46 pm
In Fire Emblem, you know how the enemy attempts to get near you when you're near his attack range?
Can anyone get me a pseudocode of how to make that happen?
The map will be tilemap and players have the character code less than 50.
Title: Re: Fire Emblem style enemy AI help
Post by: squidgetx on May 14, 2012, 10:28:35 pm
I'm not familiar with Fire Emblem, but you could just loop through all the tiles surrounding the enemy to check if the player is there. If the player is within range, store the player's coordinates and use some basic algebra to figure out what direction to move towards. Hopefully this is somewhat helpful; if you could describe the movement style more I might be able to come up with something more specific