Created
July 10, 2013 02:56
-
-
Save nklsrh/5963128 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
// limit ball's y-speed to 2x the x-speed | |
// this is so the ball doesn't speed from left to right super fast | |
// keeps game playable for humans | |
if (ballDirY > ballSpeed * 2) | |
{ | |
ballDirY = ballSpeed * 2; | |
} | |
else if (ballDirY < -ballSpeed * 2) | |
{ | |
ballDirY = -ballSpeed * 2; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment