Reverse lerp?

Get help using Construct 2

Post » Tue Aug 12, 2014 6:56 pm

Is it possible to make a lerp that speeds up towards the end instead of slowing down?

I'm currently trying to make a jumping system for an 8-directional character. It check's player's current standing position and records it on every tick, and when jump button is pressed, the character should lerp into say, Player_StandY -200, sending the player upwards. This part works well, but when I use lerp to send player back to the original position, the speed curve is wrong. The character slides quickly towards floor and slows down before impact. What I want is the reverse effect. The character should start falling slowly and gain speed while moving forwards, just like in real life.

EDIT: Maybe I'm trying to do this the hard way and should use a platform behavior instead?
B
21
S
7
G
4
Posts: 233
Reputation: 3,474

Post » Tue Aug 12, 2014 9:31 pm

I would say 3 things:

1/lerp is not meant, and should not be used the way I think you are using it (set Y to lerp(Self.Y, finalYposition, speed) I presume?), and it will also result in an anormal curve.

2/a quadratic formula to increase the player speed to the bottom should be used in this kind of movement

3/ The platform behavior actually does the 2/ by itself, so I think it would be wise to consider using it.
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123

Post » Wed Aug 13, 2014 1:03 am

Alright. I went with the platform method. It does the job so far. Thanks for the help :)
B
21
S
7
G
4
Posts: 233
Reputation: 3,474


Return to How do I....?

Who is online

Users browsing this forum: NN81, Phacanu and 6 guests