Hello, here im going to show you how to make a pushback effect on a character.
What is the pushback effect?
When you hit an enemy in a game, he will jump backward, that's what we call a pushback effect. It will work on Platformers only !
How to do it?
That's why i made this tutorial!
Prepare the scene
First, i will make the layout with a player with a sword (blue), an enemy (red) and the ground (grey)
And give them their behaviours :
Player = Platform (Must be platform), ScrollTo (optional) and Solid
Enemy = Platform and Bullet (For the PushBack)
And edit behaviours properties to match mines :
Enemy Bullet behaviour = Speed (350), Acceleration (40), Initial state (Disabled)
Events
Now go to the Event Sheet.
We will first, make the system events to force the enemy to ignore when you press arrow keys to never move with the player.
Now the PushBack event :
When the player hit the enemy (on collision), the enemy will be shot backward like a bullet for 0.3 seconds then stop.
Now you ave the push back effect! You can edit your game and this effect with your own ideas and sprites to make it better for your game.
Thanks for reading this tutorial ;)