I would give each enemy four variables, OldX, OldY, XDirection, YDirection.
When an enemy is spawned and positioned, set Enemy.OldX = Enemy.X and Enemy.OldY = Enemy.Y
For Each Enemy | Enemy.XDirection = Enemy.X - Enemy.OldX
| Enemy.YDirection = Enemy.Y - Enemy.OldY
(subevent)
If Enemy.XDirection = 0 | (here you would display the enemy standing still)
If Enemy.YDirection = 0
(subevent)
Else
(subevent)
If Enemy.XDirection < 0 | (face the enemy to the left)
(subevent)
Else
If Enemy.XDirection > 0 | (face enemy to the right)
(subevent)
Else
If Enemy.YDirection < 0 | (face enemy up)
(subevent)
Else | (face enemy down)
(subevent)
Enemy.OldX = Enemy.X
Enemy.OldY = Enemy.Y
This will check every enemy every tick, so it may slow your game down. If it does, you could stagger
the enemies so it takes 3 or more ticks to check the direction of all the enemies, rather than all of them
in 1 tick. Let me know if you would need help doing that.
Also, if you wouldn't need to use Enemy.XDirection or Enemy.YDirection anywhere else in the game, you could make them local variables above the For Each event, rather than each Enemy holding their own copy of the variable.