How do I jump towards a position?

Get help using Construct 2

Post » Wed Jul 05, 2017 1:42 pm

Hi guys,
I'm developing a platform-based mobile game. I would like my player to jump towards a touch position. On touch on screen, the player should jump towards it with some strength but should not reach it.

Please help.

Thanks,
Sudeep
B
24
S
7
Posts: 335
Reputation: 2,220

Post » Wed Jul 05, 2017 3:23 pm

Maybe use lerp(object.position, touch.position, %) then vary the % from 0 to 95% over some time.
https://www.ravenheart.ca/home
Company name changed to avoid Facebook-type shenanigans

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,415
Reputation: 4,824

Post » Wed Jul 05, 2017 6:37 pm

Hey gumshoe2029, I could use lerp but it slows down the movement at the end point. Instead of that I used Physics behavior to the object and set the event to "On touch start -> Apply physics force toward (Touch.X, Touch. Y)" but the movement doesn't look realistic. The game is climbing up branches so when I tap on particular position on the screen the player should jump towards that position. Also, jump-thru behavior is not working.

Any idea? Thanks.
B
24
S
7
Posts: 335
Reputation: 2,220


Return to How do I....?

Who is online

Users browsing this forum: blackhornet, dop2000, mihirolover, tarek2 and 8 guests