Stomping on enemy problem. Please Help.
![Gallardo](http://forums.gamesalad.com/applications/dashboard/design/images/defaulticon.png)
I am creating a platformer with a Mario-Style-Jump. I cannot destroy the enemy by jumping on him. If I jump when the enemy passes in front of me only then is he destroyed. How can I destroy the enemy by only falling/jumping on him and not when I jump when he is in front of me?
Player Rules: constrain game.MainPlayer.Height to self.Size.Height
constrain game.MainPlayer.Position to self.Position.Y
Enemy Rules: Outer: Actor receives event, collides with Player
Inner: Attribute game.MainPlayerPosition greater-than-or-equal-to
self.Position.Y + self.Size.Height/2 + game.MainPlayerHeight/2
I will really appreciate any help. Thank
Player Rules: constrain game.MainPlayer.Height to self.Size.Height
constrain game.MainPlayer.Position to self.Position.Y
Enemy Rules: Outer: Actor receives event, collides with Player
Inner: Attribute game.MainPlayerPosition greater-than-or-equal-to
self.Position.Y + self.Size.Height/2 + game.MainPlayerHeight/2
I will really appreciate any help. Thank
Comments
Create new rule
If player.motion.linear.Y is less then -1
Change attribute game.jumpkill to true
Otherwise
Change attribute game.jumpkill to false
On your enemy
Create new rule
If actor collides with player
If game.jumpkill is true
Destroy