Created
October 6, 2014 20:07
-
-
Save anonymous/0de6c42711d8840fb0c5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ((jumptime < 0 && keys[KEY_JUMP]) || (jumptime < 0 && jumptime < 0 && !grounded && !sliding)) { | |
dataPhysical.xa = jumpSpeedX; | |
dataPhysical.ya = -jumptime * jumpSpeedY; | |
jumptime++; | |
} else if ((grounded && mayJump && keys[KEY_JUMP]) || (grounded && mayJump && jumptime < 0 && !grounded && !sliding)) { | |
jumpSpeedX = 0; | |
jumpSpeedY = -1.9f; | |
jumptime = (int) JUMP_TIME; | |
dataPhysical.ya = jumptime * jumpSpeedY; | |
grounded = false; | |
sliding = false; | |
} else if ((sliding && mayJump && keys[KEY_JUMP]) || (sliding && mayJump && jumptime < 0 && !grounded && !sliding)) { | |
jumpSpeedX = -dataPhysical.facing * 6.0f; | |
jumpSpeedY = -2.0f; | |
jumptime = -6; | |
dataPhysical.xa = jumpSpeedX; | |
dataPhysical.ya = -jumptime * jumpSpeedY; | |
grounded = false; | |
sliding = false; | |
dataPhysical.facing = -dataPhysical.facing; | |
} else if ((jumptime > 0 && keys[KEY_JUMP]) || (jumptime > 0 && jumptime < 0 && !grounded && !sliding)) { | |
dataPhysical.xa += jumpSpeedX; | |
dataPhysical.ya = jumptime * jumpSpeedY; | |
jumptime--; | |
} else if (keys[KEY_JUMP] || (jumptime < 0 && !grounded && !sliding)) { | |
// noop | |
} else { | |
jumptime = 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment