How do I make an enemy bounce off after hitting the player

  • I'm trying to program a simple AI so that the Sprite will move towards the player when he comes on screen, and then attack. My mechanics are very simple since I am a total noob so the sprite's attack is just running into the player. I would like to create a bounce effect so the sprite will bounce off after hitting the player, then continue attacking.

    Image of my event sheet here: imgur.com/gallery/Lqw12ws

    As you can see in the image- (@Green Arrow) the wolf is still when the global variable "Wolftrigger" is 0, and when he comes into view it increases to 1 and he goes at the player (so far, so good).

    But I tried to create a system (@Red Arrow) where the "Wolftrigger" moves up to 2 and he bounces off after a successful attack, but it doesn't seem to work. When I play test he turns around a bit, but he does not jump back the way I would like.

    As you can see I'm using a bullet movement behavior and that may be my problem. I also did try using the actual "bounce" line but it barely bounces off at all. Any advice you could give would be great, as I said total newb here- THANKS.

  • Posted image for you

    Just a thought, you could set angle/speed of bullet directly - rather than using the bounce function in the bullet behaviour?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Just a thought, you could set angle/speed of bullet directly - rather than using the bounce function in the bullet behaviour?

    Thank you!

    The bounce function at #14 is a relic of a failed attempt to use tat function, but if you look at #15 I have tried to reset the angle away from the player and increase the speed for the bounce/jump-back effect I'm looking for.

    Thanks again for the tip and posting the picture.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)