Jumping over objects while in motion

  • Thread starter Thread starter kool_j
  • Start date Start date
  • Tags Tags
    Motion
AI Thread Summary
To create a jumping mechanic in a PC game where an object (object A) jumps over a stationary object (object B), a parabolic motion model can be applied. The x-component of the velocity remains constant, while the y-component is influenced by the initial jump velocity (y0) and gravity (g). The formula y(t) = y0t - (1/2)gt² can be used to calculate the jump's height and duration. Adjusting y0 will increase jump height, while modifying g will affect gravitational pull. This approach allows for a realistic jumping arc in platformer-style games.
kool_j
Messages
1
Reaction score
0
Hi,
I'm in the process of designing a PC game and I need to make objectA ,which is driving along to jump over object B which is stationary in its path. Can anyone tell if there is a formula to work out this type of motion.
Thanks :cry:
 
Physics news on Phys.org
A simplistic way to do it would be to assume the jumper is like rigid body and follows a parabolic path while in the air. Let's call the direction in which the jumper is running the x-direction and up will be the y-direction.
Then when jumping, the x-component of the velocity will not change.
For the y-direction, you'll have to know how high he/she will jump, which is determined by it's initial velocity in the y-direction. Let's call it y0.
Then y(t)=y_0t-\frac{1}{2}gt^2.

For your game I think you'll have to tweak y_0 and g.
A higher y0 means a more powerful jump.
A higher g means a stronger gravitational field.
 
I assume youre looking at the object that's jumping from side on right?
(Like a Platformer) I also assume that you must be keeping its x, y
velocities independent from each other.

y

|
|
|
|________ x

If that's the case, keep your x-velocity constant as the jump is made.
To start with, set the y-vel to some positive value.
(yVel = startYVal)
(This will set how high you want to jump)
As time passes, change your y-velocity as follows:
yVel = oldYVel - g*t**2,
(where t is time and g is some constant that will set your gravity)
When yVel == - startYVal, then set yVal to 0 and end your loop.
(Otherwise your character will just fall straight through the platform)

This should give you a nice parabollic shape for your jump.

Sorry... I couldn't think of any simpler terms to explain this in.
Enjoy making the game! :biggrin:
 
Thread 'Is 'Velocity of Transport' a Recognized Term in English Mechanics Literature?'
Here are two fragments from Banach's monograph in Mechanics I have never seen the term <<velocity of transport>> in English texts. Actually I have never seen this term being named somehow in English. This term has a name in Russian books. I looked through the original Banach's text in Polish and there is a Polish name for this term. It is a little bit surprising that the Polish name differs from the Russian one and also differs from this English translation. My question is: Is there...
Hi there, im studying nanoscience at the university in Basel. Today I looked at the topic of intertial and non-inertial reference frames and the existence of fictitious forces. I understand that you call forces real in physics if they appear in interplay. Meaning that a force is real when there is the "actio" partner to the "reactio" partner. If this condition is not satisfied the force is not real. I also understand that if you specifically look at non-inertial reference frames you can...
Back
Top