u could do a variable and add px's or distance traveled to it, based on player movement, for example u would need 2 variables
oldX and curentX
the condition format must be like this to be able to check distance and rewrite
everytick setoldx >player.x
onleftpress orRightpress > setcurentX to player.x
compare two variables > distance(oldx, 0 , curentx,0 ) is greater or equal 200 >action> create zombie at player.x +100px (or -100px depending where the player is facing.)
not sure if u want it like this, but what this would do is check if the distance between last position of player and curent position is greater or equal to 200px then will spawn a enemy around player at 100 px, to check where the player is facing, you could make use of the left and right button when u move by adding a 3rd variable and call it "moveLR" value of 0 being left and 1 being right
and when u press left u setup moveLR to 0 and when u move right u setup moveLR to 1
then u just check if moveLR is 0 or 1 and spawn the zombie to player.x-100px if moveLR = 0 and player.x + 100px if moveLR=1
i can do a quick example if u want.