Last active
December 11, 2015 20:59
-
-
Save mackwic/4659006 to your computer and use it in GitHub Desktop.
This file contains 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
void moveRight(float step, float oldAngle) { | |
float diffAngle = abs(oldGravityAngle - world.getGravityAngle()); | |
Vec2 velocity = new Vec2(getXVelocity() * cos(diffAngle), getYVelocity() * sin(diffAngle)); | |
Vec2 gotoRight = new Vec2(step * world.getGravityForce() * horizontalSpeed, 0); | |
Vector.rotate2D(gotoRight, world.getGravityAngle()); | |
applyImpulse(gotoRight.x, gotoRight.y); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment