I am currently using this for grid movement
dir = 0
step_timer = 0
speed = 1
grid_size = 32
The player and Enemy moves in a 32x32 grid, one box at a time. The AI is currently Automoving where it chooses either 0, 90, 180 or 270 for its dir value randomly every second. I am trying to make a Line of Sight behaviour for the EnemyAI to chase the player
Right now i have it like this
EnemyAI X < Player.X = EnemyAI set dir to 0 Moving right
EnemyAI X > Player.X = EnemyAI set dir to 180 Moving left
EnemyAI Y < Player.Y = EnemyAI set dir to 90 Moving down
EnemyAI Y > Player.Y = EnemyAI set dir to 270 Moving up
However the EnemyAI suddenly reaches a point where its just standing still and the animation keeps lookin up and down. I think the 4 codes are overlapping eachother in some bad way.