what i need to perform jump???????????????????
love and peace
love and peace
Legs!!!!!!!!!!!!!!!!!!!!!!!
Seriously though, we need more information.
Helpful links:
How To Ask Questions The Smart Way | Google can help with your question | Search MSDN for help with standard C or Windows functions
Seriously though, we need more information.
Helpful links:
How To Ask Questions The Smart Way | Google can help with your question | Search MSDN for help with standard C or Windows functions
what information are you talking about??????
is there any theoric formula to perform this???????
the thorie i need
love and peace
is there any theoric formula to perform this???????
the thorie i need
love and peace
love and peace
The objects are always affected by the gravity. Anywhere in the game, the objects move down and stopped by some other static object. To jump, we need to add some to the jumping object so that it will "release" itself from the gravity for a little while.
Declare some variable "jump". Set this to 0. Every frame, you add this to the gravity on the object to jump. Nothing happens, right?
When the object wants to jump (the player might press the jump-key/button), you set jump to something high, like 10. Keep adding this jump variable to the gravity as usual and you''ll notice the object will go up. Also, you need to lower jump, so that the object won''t fly away. Remove 0.1 or something every frame and the jump will slow down. When jump is zero, stop decrementing it
That''s all!
Declare some variable "jump". Set this to 0. Every frame, you add this to the gravity on the object to jump. Nothing happens, right?
When the object wants to jump (the player might press the jump-key/button), you set jump to something high, like 10. Keep adding this jump variable to the gravity as usual and you''ll notice the object will go up. Also, you need to lower jump, so that the object won''t fly away. Remove 0.1 or something every frame and the jump will slow down. When jump is zero, stop decrementing it
That''s all!
simply remember your Z-Velocity. Gravity modifies it, but as you land on the ground, Z-velocity will be set to 0 again.
This is some pseudo-code to do it.
jump()
{
if (Vz == 0) // you have to stand on the ground to jump
{
Vz = 3; // simply set some speed to your z-speed
}
}
gravity()
{
Vz -= 9.81*ticktime; // gravity modifies your speed
// ticktime is time a tick in your engine lasts
if (char_stands_on_ground)
{
Vz = 0; // if you standing on ground, set Z-speed to 0
}
PosZ += Vz; // adjust your z-position with the z-velocity
}
This is some pseudo-code to do it.
jump()
{
if (Vz == 0) // you have to stand on the ground to jump
{
Vz = 3; // simply set some speed to your z-speed
}
}
gravity()
{
Vz -= 9.81*ticktime; // gravity modifies your speed
// ticktime is time a tick in your engine lasts
if (char_stands_on_ground)
{
Vz = 0; // if you standing on ground, set Z-speed to 0
}
PosZ += Vz; // adjust your z-position with the z-velocity
}
-----The scheduled downtime is omitted cause of technical problems.
quote:
Original post by okouya
this is simple as a response
okouya,
When you ask for advice and information in this forum, please provide us with sufficient information. You have only posted a very broad question with no details on your accomplishments to date, and no information your game setting. I''m afraid this is just not enough for us to go on. Nor is it sufficient to motivate us to help.
Please provide a concise statement of your game project, the specific type of jump you want to implement, as well as a brief statement of what you have accomplished to date and what your own approach is to trying to solve the problem. If you can provide a small amount of source code (5-10 lines maximum) then post that as well. Show us that you actually have a plan, and have done some work on your own, and we''ll be more willing to provide assistance,

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
April 23, 2002 08:46 PM
a couple of things to consider when doing jumps besides physics.
how do the characters animations sync up with your jump physics?
how does the camera move in response to your jump?
these two things alone have HUGE consequences on how your jump looks and feels.
how do the characters animations sync up with your jump physics?
how does the camera move in response to your jump?
these two things alone have HUGE consequences on how your jump looks and feels.
April 25, 2002 11:42 AM
Probably very stubid idea, but anyway... (usually results of stupid ideas is outstanding
)
Besides the gravity, you can implement smth. like elasticity, that is put a spring into the legs (or whatever is jumpig there!): now when IT jumps the spring shrinks, (the initial amplitude depends on what jumping-height you need, and is a parameter to jump function - for example the longer i press ''j'' button - the highest the jump is) and afterwards it is released... consequent movement is defined by gravity... but when IT collides with floor - the spring shrinks again... and so on.
What about camera movement - it''d be beautiful if it moved 2-3 times slower than Jumping-object, and with less amplitude - e.g. smoothly - like the camera outside the car in Need for Speed 5!
Good luck!

Besides the gravity, you can implement smth. like elasticity, that is put a spring into the legs (or whatever is jumpig there!): now when IT jumps the spring shrinks, (the initial amplitude depends on what jumping-height you need, and is a parameter to jump function - for example the longer i press ''j'' button - the highest the jump is) and afterwards it is released... consequent movement is defined by gravity... but when IT collides with floor - the spring shrinks again... and so on.
What about camera movement - it''d be beautiful if it moved 2-3 times slower than Jumping-object, and with less amplitude - e.g. smoothly - like the camera outside the car in Need for Speed 5!
Good luck!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement