Hey everyone. I’m creating a Zombie game. I’m trying to code an effect, that will push the enemy back when hit. It has to be pushed in the same direction, as the bullet is flying. Something like:
Enemy.x -= Bullet.rotation;
Enemy.y -= Bullet.rotation;
I really don’t know how to do it, so no matter which way the bullet is flying, the enemy will be pushed in the same direction. Could anyone please help me with this?
Regards,
Mathias
EDIT
I fixed it, it works now!