I developing a 2d retro platformer game and I want to add a slime enemy that the player will bounce every time he jumps on the slime. I will use this mechanic to create a more dynamic level design where the player have to jump on the enemies access some platforms and so on.

If your character is moving using physics, you can simply apply an upward force when the character collides with the enemy.

If you're using more manual movement, then make sure you have a variable representing upward movement that decreases over time as long as it is above 0. Factor that into your movement code.

3 years later