Bounce after smashing the enemy
![Gallardo](http://forums.gamesalad.com/applications/dashboard/design/images/defaulticon.png)
What rule can I create which will make the player bounce up when he smashes an enemy? I want to give room to change the enemy sprite to that of a smashed one. Here is an example of what I want to do.
http://imageshack.us/photo/my-images/696/supermariojump.png/
Any help would be greatly appreciated.
http://imageshack.us/photo/my-images/696/supermariojump.png/
Any help would be greatly appreciated.
Comments
Global boolean called jumpkill
Player"
If player.motion.linear.Y is less then -1
Change attribute game.jumpkill to true
Otherwise
Change attribute game.jumpkill to false
Enemy:
If actor collides with player
If game.jumpkill is true
Destroy
Thanks to BrynjeBamsen, this allows my player to kill the enemy only when I hit the enemy from the head.
But now how do I make player bounce up when I kill enemy?
However make sure your actor also has some sort of gravity, otherwise you'll just keep moving up.
Hope this helps!
The reason that I am avoiding "collides with enemy" is that I want to destroy the enemy only when I hit his head and not when I run into him. Running into the enemy is also considered a collision. Establishing this specific preference, I am trying to create a rule which creates the bounce only after I have fallen on top of the enemy.
To satisfy my preference for how to destroy the enemy I would like to maintain the stated rules I have for the player and the enemy. How can I add the bounce to the player which is caused by destroying the enemy while maintaining these stated rules?
This is a tough one.