If the character was rolling before jumping, player control of left and right movement is disabled until landing. Holding the jump button when upward velocity is less than 1024 subpixels per frame has no effect on the game. One frame's worth of airdrag will occur at the same time as the drop to 968 subpixels upward. Releasing the jump button when upward velocity is more than 1024 subpixels (3 & 5/32 pixels) per frame causes the upward velocity to drop to 968 subpixels per frame on the next frame. So, for instance if you have a horizontal speed of 3072 subpixels (12 pixels) per frame at the start of a jump, once you start to reach its peak, you'll lose 96 subpixels the first frame, 93 the second, 90 the third, and so on, until your vertical speed reaches 0, or your horizontal speed is below 32 subpixels per frame. Y velocity between subpixels (0-4 pixels), and happens at a rate of 1/32nd the current horizontal velocity per frame. When a character jumps, a vector of their jump height is added to their current x & y velocities at a 90 degree angle to the slope they are currently standing on.ĭuring a jump, air drag occurs whenever the character has an (upward) Jumping is a function of vector addition.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |