Platformer Enemy

I am making a platformer game but I am having trouble making an enemy that sits on the ground and kills the player if you run into it’s side and it dies if it is jumped on by the player. Could I get some help?
Here is what I have so far:

When I run the game Luigi has an animation that makes his head change direction. He will only kill me if I run into his side while he is looking to the right. On any other collision he will just die.

Hm, the animation might be affecting the calculation of where the “bottom” of the sprite is. If you update your check to see if the Player is moving down AND the Player position is currently above Luigi’s position, you should be able to detect if the Player is “falling” onto Luigi. Try this out:

(Demo here: