How do I Fix this Jumping motion?

Get help using Construct 2

Post » Tue Jun 24, 2014 9:29 pm

I've been looking at ways to incoporate a Sonic style jumping to my game, where the height/power of the jump is determined by how long the user touches the screen.

I found a helpful solution to this by @MrGoatsnake here (remove the space between the slash next to https: and the space after www.) -

http:/ /www. scirra.com/forum/simulate-change-keyboard-buttons-to-touch-screen_t106759

This thing with this is when i tap the screen (mouse click in this case) the player does do a small jump, which is what i want but i don't like the way the jump occurs. When the player does the small jump, it looks as if it's hitting an invisible block and just coming straight back down (best way i could describe it :)) When the player does a high jump by holding the jump button, the jump looks fine.

I would like to fix this jumping motion so that the small jump looks like a small jump rather than how i described it. Is there any way to do this?

I hope i've made it clear what i'm looking for, might be a bit confusing.

I've provided the capx file from that thread, credit goes to MrGoatsnake.
You do not have the required permissions to view the files attached to this post.
B
5
S
2
Posts: 126
Reputation: 876

Post » Wed Jun 25, 2014 2:55 am

@tomhaiger Credit really goes to Scirra's great community. I dug that explanation up from deeper in the forums. I am glad you found it.

To address the "invisible wall," the reason it looks like it is hitting something is the abruptness of the change to the player's Y vector; from Y to 1/4 of Y. At 1/4 acceleration upward, gravity takes over really quick.

You can tweak the change in the Y vector so the jump will drop off slower. I have attached a version where I have Y/2 instead of Y/4 and it feels a little less like a wall. :)
You do not have the required permissions to view the files attached to this post.
B
21
S
5
G
1
Posts: 96
Reputation: 1,937

Post » Wed Jun 25, 2014 2:04 pm

@tomhaiger You inspired me enough to write this up in a tutorial for people looking around on the site.

https://www.scirra.com/tutorials/1048/p ... k-duration

I hope @Ashley can correct me on any of the physics if I'm wrong. I took a good guess at what I thought Construct is doing. I tried to simplify my explanation as well but its been a few years since I developed my own physics engine in graduate school. I'm a bit rusty.
B
21
S
5
G
1
Posts: 96
Reputation: 1,937

Post » Wed Jun 25, 2014 2:34 pm

Thanks @MrGoatsnake It seems to be better now, and with such a simple change :)

Also great job with the tutorial. Thanks for taking the time out to do this, i'm sure this will help a lot of people out.
B
5
S
2
Posts: 126
Reputation: 876


Return to How do I....?

Who is online

Users browsing this forum: YoHoho and 7 guests