How do I make knockback?

Get help using Construct 2

Post » Tue Apr 29, 2014 6:37 pm

How to do that when you touch the opponent he bounces?
B
4
S
1
Posts: 14
Reputation: 719

Post » Tue Apr 29, 2014 9:25 pm

Perhaps by getting his X position and add or subtract (depending on which side he is in relation to the player) a value to it?

---> Player on collision with Enemy (this condition is a trigger, that's important)
-------->(sub-event 1) if Player.X < Enemy.X ---> Set Enemy X position to self.X + 30 (the enemy will be pushed 30 pixels to the right)
-------->(sub-event 2) if Player.X > Enemy.X ---> Set Enemy X position to self.X - 30 (the enemy will be pushed 30 pixels to the left)
composer - multimedia artist
www.eli0s.com/en/
B
69
S
27
G
6
Posts: 1,146
Reputation: 10,379

Post » Tue Apr 29, 2014 9:48 pm

I did some sort of knock-back for my ChocolateHearts game. what I did is I moved the enemy or the player a few pixels back based on where the hit came from. (player shoots the zombie - zombie gets hit by "blast" and is knocked back a few pixels )
Here's a screenshot of what I used in my events:
You do not have the required permissions to view the files attached to this post.
Freefall Bird
B
47
S
9
G
5
Posts: 281
Reputation: 5,803

Post » Thu May 01, 2014 7:07 am

Thanks
B
4
S
1
Posts: 14
Reputation: 719


Return to How do I....?

Who is online

Users browsing this forum: draiza and 6 guests