Author Topic: Fire Emblem style enemy AI help  (Read 2550 times)

0 Members and 1 Guest are viewing this topic.

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Fire Emblem style enemy AI help
« 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.
Sig wipe!

Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Re: Fire Emblem style enemy AI help
« Reply #1 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