# How do I make a RPG character jump anywhere using Lerp ?

0 favourites
• 7 posts
From the Asset Store
With this template you will learn how to use the GooglePlay Games native plugin
• I have a RPG type of game. How do I make a character jump anywhere on map (to a specific X,Y position) using Lerp like in the following image ?

The green circle is the shadow (the actual Sprite controlled by the user)

The little guy is the player/main character and is pinned to the green circle

• Anyone ?

• Help

I've read this and this , but still can't figure how to use it in C2

So the formula is lerp(a, b, x) . What means every variable from the formula and how do I use it with Move To ?

• I think this might help you, it is not commented though (not much time for now), just click on the green squares to see the player jump.

• Thanks, is exactly what I wanted

Still can you explain the formula lerp(a, b, x) ? I understand that a=current position, b=destination and x=speed, but I can't figure how x works. I want to understand it in order to use it for menus. Using these examples, how can I make the "easeOutBack" or "easeOutExpo" ?

• Thanks, is exactly what I wanted

Still can you explain the formula lerp(a, b, x) ? I understand that a=current position, b=destination and x=speed, but I can't figure how x works. I want to understand it in order to use it for menus. Using these examples, how can I make the "easeOutBack" or "easeOutExpo" ?

In fact, lerp(a, b, x) is:

a: start number

b: end number

x: percentage (0 to 1) between a and b

But most people instead of making x varies, makes a variying, for exemple, if a is your current position, b your destination, and x is 0.5, theneach time, the distance between you and b will be divided by 2

• ## Try Construct 3

Develop games in your browser. Powerful, performant & highly capable.

Construct 3 users don't see these ads
• Thank you very much

• 7 posts