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

Get help using Construct 2

Post » Sun Apr 27, 2014 10:29 pm

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 ?
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
B
49
S
15
G
6
Posts: 534
Reputation: 7,195

Post » Mon Apr 28, 2014 5:05 pm

Anyone ?
B
49
S
15
G
6
Posts: 534
Reputation: 7,195

Post » Tue Apr 29, 2014 5:24 pm

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 ?
B
49
S
15
G
6
Posts: 534
Reputation: 7,195

Post » Tue Apr 29, 2014 6:02 pm

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.
You do not have the required permissions to view the files attached to this post.
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 » Tue Apr 29, 2014 6:37 pm

@Aphrodite
Thanks, is exactly what I wanted :D
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" ?
B
49
S
15
G
6
Posts: 534
Reputation: 7,195

Post » Tue Apr 29, 2014 6:43 pm

TGeorgeMihai wrote:@Aphrodite
Thanks, is exactly what I wanted :D
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
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 » Tue Apr 29, 2014 7:30 pm

@Aphrodite

Thank you very much :)
B
49
S
15
G
6
Posts: 534
Reputation: 7,195


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, cb130felix, Kermad, nyuszi008, yiuyiu6666 and 8 guests