Don't allow a negative ball speed

This commit is contained in:
hasufell 2014-06-02 00:13:15 +02:00
parent 919436f997
commit aa59033d28
No known key found for this signature in database
GPG Key ID: 220CD1C5BDEED020
1 changed files with 2 additions and 1 deletions

View File

@ -817,7 +817,8 @@ void keyboard(unsigned char key, int x, int y)
glutPostRedisplay();
break;
case 'K':
ball_speed -= 0.2f;
if (ball_speed - 0.2f > 0)
ball_speed -= 0.2f;
glutPostRedisplay();
break;
case 'f':