E
Emberex
Guest
I am creating a top down, but the player and enemies sprites only face left and right in a cartoonish way. I am trying to create knockback and have tried many different ways, it seems as though it should be simple and I believe it is, I just can't figure it out. This one code here stumps me, I thought it would knock me left or right depending on where the zombie is to the player, but the player is only knocked left, right is that?
GML:
if(place_meeting(x,y,oZombie)){
if(instance_nearest(x,y,oZombie) > x){
x -= 8;
}
if(instance_nearest(x,y,oZombie) < x){
x += 8;
}
}