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

Get help using Construct 2

Post » Sun Apr 10, 2016 4:03 pm

Message: MinkDingus can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
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: http://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.
B
9
S
1
Posts: 13
Reputation: 508

Post » Sun Apr 10, 2016 5:06 pm

Posted image for you Image

Just a thought, you could set angle/speed of bullet directly - rather than using the bounce function in the bullet behaviour?
Image
B
27
S
9
G
5
Posts: 488
Reputation: 11,948

Post » Sun Apr 10, 2016 7:10 pm

JohnnySix wrote: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.
B
9
S
1
Posts: 13
Reputation: 508


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 20 guests