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: 337
Reputation: 2,224

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
I don't check the forums much anymore, but I will receive an email for PMs.

"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
23
S
6
G
1
Posts: 1,419
Reputation: 4,867

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: 337
Reputation: 2,224


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 24 guests