Game Maker Tutorial – KnockBack Effect 2.0

Brand new 2017 Game Maker Studio: 2 Course available right now

In this video we learn how to add a proper knockback effect that you can add into your game. If you have any questions then be sure to leave a comment or contact me on twitter; realtutsgml. If you learned something then be sure to leave a like, comment, and favorite.

Have you ever wanted to create games? Have you ever gotten fed up with it being to difficult? Well now is the time to thank me and possibly subscribe because you have just found the channel for you! Game Maker Tutorials, Java Game Programming, Unity3D Tutorials, Batch, C++ and much much more! This is the channel for you, the one stop shop for an exploration of your hidden talent as a game developer. Unleash your potential and go wild with imagination when you finally figure out how to make any game you want!

KnockBack Effect 1.0 –

Outro Song:
Name: Spitfire (Kill the Noise Remix)
Artist: Porter Robinson
Youtube channel: /user/PorterRobinsonMusic

Visit CodingMadeSimple for more exclusive tutorials and get the help you need to succeed as your very own indie game developer!

Follow me on twitter for exclusive content and interaction with me!

Game Maker Studio: Programming
Game Maker Studio: Tutorial
Java Programming
Game Programming
Game Tutorial
Programming Tutorial






39 responses to “Game Maker Tutorial – KnockBack Effect 2.0”

  1. John Doe Avatar

    but how do I prevent the enemy from going through objects during the knockback?

  2. Samuel Rasquinha Avatar

    Yeah Please do a tutorial on platformer knockback!

  3. Seth Rung Avatar

    Can you do one for destructible environments so it shakes but still stays in place in a physics room with physics collisions. That would be dope also make it so the wall or object switches sprites to create the effect of being destroyed. I tried to create the effect by stacking objects and it works I just feel like there is a better way to do it. Tks your videos are great.

  4. Jhonny Stevenson Avatar

    Do you do the same thing for when you want the player to knock back after getting hit by an enemy?

  5. MI7QC Avatar

    can we create the same thing with one block to hero and when the hero touch the block is knockback?

  6. jalecko 898 Avatar

    Pls do a tutorial on platformer knockback

  7. Matt Nichols Avatar

    You're a rockstar, keep this up!

  8. Hajae Ko Avatar

    This one was much better and very helpful. Thank you!

  9. Darius TGP Avatar

    Thanks for this video! 😀
    What I was doing was- Collision event with <insert object here>, jump to relative position -30x,-30y  which only made it jump in that direction, and if you were on the opposite side of that, the enemy would fly through you and do alot more damage that it was supposed to, this helped alot 😛

  10. April Hall Avatar

    what I put in the step event to make this a backwards dash for my player

    /// Player back dash 
    if (dir=1) and keyboard_check_released(vk_shift)

        hspeed = -8 
        sprite_index = evade_right  
        alarm[1] = 15;}
    if (dir=-1) and keyboard_check_released(vk_shift)

        hspeed = 8
        alarm[0] =15;}

    if hspeed = 8{
        sprite_index = evade_left} 
    if hspeed = -8{
        sprite_index = evade_right}

  11. April Hall Avatar

    think about adding this to a player for a dash effect 

  12. Cobey Smith Avatar

    wuh? if i shoot the enemy when it has its back to me and when i shoot him, the knock back makes him come towards me instead of actually knocking backwards. so pretty much knocking foraward

  13. Sammy Avatar

    hey i would appreciate if you could make a video, or tell me if you have one. about how to make my player just get hit once. like if my player is hit by a rolling boulder, i dont want the boulder to be destroied, but if a do it like that the player keeps taking damage as long as the boulder is touching it. i just want to hit it once and to pass through it. same for one touching enemies by accident. do you get what im saying?
    please help!! i really find your tut very helpful!

  14. meteoridragon7 Avatar

    I really appreciate this tutorial and I wanted to expand on it. I combined this tutorial and your platformer-AI-chasing tutorial. The basic idea of what I did was direction=obj_bullet.direction. and speed=obj_bullet.speed. This way the enemy doesn't need to be chasing you. He can be roaming. The problem is that if the enemy is knocked into a wall at an angle, the it doesn't move at all. I want it to slide along the wall. Think you could help?

  15. Phil Langdon Avatar

    Very cool! Yet another great tutorial. Thank you so much.

  16. Marcus Korvenius Avatar

    hmm…this does not work how i want.

  17. OhHeyItsCory Avatar


  18. Marcus Korvenius Avatar

    its the same way it works here, instead of collision with bullet, you need to add block collision with player and set the alarm so that you wont get blown off the screen.

  19. Caleb Behrens Avatar

    Can you make a knockback tutorial that works for a 2D Platformer? Like if a character touches an object he gets knocked back up and in the opposite direction he was traveling in?

  20. Jack Eggebrecht Avatar

    Thanks, I've implemented the knockback in my Step movement function for the player, so it doesn't set a direction, just increments the player's movement until an alarm told the step event to stop the knockback. It works, and even though it's a bit of a hack (bullets from very different directions will cause it to move back and forth, I'll keep it for now).
    Also, I should have mentioned that my game has 360 rotating movement, so only 8 directions wouldn't work. Thanks though.

  21. RealTutsGML Avatar

    Yes, Search on my channel "8 Direction Movement" and use that type of movement! I also have a zombie game series that shows how to make a top down game with that movement.

  22. Jack Eggebrecht Avatar

    I'm trying to give my player knockback in a top down shooter, but whenever I knock it back, the player's direction instantly switches to the colliding bullet's direction. I want the player's movement to be in that direction, but the player's direction itself to not change. Basically, I'm using the "set direction and speed of motion" D&D (blue arrows icon), but I want to set the motion's direction, not the player's direction, if that makes sense. Any help?

  23. sjohns510 Avatar

    I seriously spent all day trying to get this effect in a game I'm working on using a bunch of convoluted processes like 'jump to position's and in the end it was way easier. Thanks.

  24. Ishsi Kimber Avatar

    How is this spam!?

  25. RealTutsGML Avatar

    Look through my tutorials I have all of that already completed in a video.

  26. SirRocketdog Avatar

    Hey how to I get my player to shoot, pick up ammo etc? I need to know ASAP please I've got to hand it in for an assignment for monday 🙂

  27. lazicful Avatar

    How about friction?

  28. Waaflz Avatar

    Love your videos bro, keep up the good work!

  29. Skout Roberson Avatar

    Can you make a tutorial or tell me how to check if an object is in the view, just like checking if it is in the room but instead of the whole room, just the view. I perfer the drag and drop method because it is easier. tahnks

  30. RealTutsGML Avatar

    well the M should be lowercase, the S in speed should be lowercase and there should be no [0] in it. The A in alarm should be lowercase. And you should have an end ) after the mp_potential_step.

  31. RealTutsGML Avatar

    Well Thank You, I appreciate it. Glad you enjoyed the video.

  32. Aw3sommmmm3 Avatar

    Thank you :D. Great tutorials, you really deserve more likes. A big like from me dude 😀

Leave a Reply

Your email address will not be published. Required fields are marked *