How do I make a Platformer "pushed back" upon collision ?

Get help using Construct 2

Post » Mon Apr 13, 2015 9:42 pm

Say I have a Platformer running towards an object, upon collision, I want the platformer to be "pushed back" as though the enemy called him to "back off".

Setting the Vector X seems to not do the trick...not even when I set it to 10000000000000000.

How do I make the object bounded back horizontally ?
B
11
S
3
Posts: 283
Reputation: 1,659

Post » Mon Apr 13, 2015 10:22 pm

Image

This is what I have so far, it is not working :(

I typed in lots of zeros in my frustration that the platformer is not even moving horizontally away at all.
B
11
S
3
Posts: 283
Reputation: 1,659

Post » Mon Apr 13, 2015 10:25 pm

If your player is moving right when it collides then perhaps you need a negative vector x value? Failing that, my technique would be to give it LiteTween behavior and just temporarily disable platform behavior while he moves backwards using a tween effect. When the tween finishes, then enable platform behavior again...
B
68
S
17
G
65
Posts: 2,186
Reputation: 41,312

Post » Mon Apr 13, 2015 10:54 pm

Thank you Colludium, I hint your advise and used LiteTween, it works PERFECTLY.
Wow, that VectorX thingy is USELESS.

The Vector Y works though, but Vector X is Utterly USELESS with or without ignoring user input.
I will never touch Vector X for Platformer again.

I tried to work within the Platform's position placement feature because I don't want an external behavior that is not part of the Platform to affect positional movement to avoid glitches, seems like the internal Platform's vector X is a let down.
B
11
S
3
Posts: 283
Reputation: 1,659

Post » Fri Apr 24, 2015 9:49 pm

Seems like you have to increase the max speed a lot to make Vector X work and give a proper "push".

And I'll throw in this example I found somewhere on this board:
on collision with enemy
set vectorX: (self.X-enemy.x)/Abs(self.X-enemy.X)*1000000

this works from both left and right of the enemy and "pushes" you back in the opposite direction.
B
9
S
1
G
1
Posts: 36
Reputation: 1,199


Return to How do I....?

Who is online

Users browsing this forum: celstrider, cgsammu, justifun, LaurenceBedford, Magistross, varr and 13 guests