Can anyone tell me how to make a grid based enemy ai? can send you the cap of this game if you're interested. The AI in my game is quite simple. If the enemy is next to the player, they will always attack. If they are not next to the player, their behavior is based on one of the following patterns:
1. Random, frequent movement (rolls a 1d4 and moves in the direction that is selected)
2. Random movement, but less frequent than the first.
3. Aggressive movement - When the player is within a certain radius (around 3 squares) the enemy will start to move towards the player. If they get close enough, they will attack.
4. Intelligent movement - Works the same as the random movement but with one exception: The enemy will never move to a square that is next to the player. This means that it will always get the first strike.
If you need anything more, let me know!