Knockback damage system

Get help using Construct 2

Post » Mon Jan 13, 2014 10:35 am

Hi.

I want to create a system where the player will get knocked away from the enemy when they collide, relative to which direction the player comes from (e.g. the player is coming from the right when it hits the enemy, so it gets pushed left, etc)



How would one go about this?

Thanks : )
B
9
S
2
Posts: 7
Reputation: 914

Post » Mon Jan 13, 2014 4:21 pm

If you are using the platform behavior on the player, you can use the New Vector action adding or subtraction from vector x and vector y.

You should already have a instance variable on your player stating which direction they are going in, so based on that, you make the player get knocked back.

Here is a pretty crude example.
https://www.dropbox.com/s/1hw2sqs76iaiir9/knockback.capx
B
100
S
32
G
11
Posts: 1,552
Reputation: 21,612

Post » Mon Jan 13, 2014 4:39 pm

what movement type does your player have?

are you using platform behavior?
B
88
S
29
G
14
Posts: 1,154
Reputation: 15,003

Post » Mon Jan 13, 2014 4:44 pm

here is one I've done with the 8dir behavior

https://dl.dropboxusercontent.com/u/164432510/rebond.capx
B
5
Posts: 19
Reputation: 313

Post » Sat Nov 26, 2016 9:14 pm

Thaks @ArcadEd that helped a lot !!!! :D :D :D
B
11
S
2
G
1
Posts: 34
Reputation: 722

Post » Sat Nov 26, 2016 9:38 pm

Thanks guys
B
12
S
3
G
2
Posts: 38
Reputation: 1,380


Return to How do I....?

Who is online

Users browsing this forum: armen1997, Syazanie Amirin and 10 guests