diff --git a/.vs/AAWeb/v15/.suo b/.vs/AAWeb/v15/.suo index 4a684b9f4..8e9180fa7 100644 Binary files a/.vs/AAWeb/v15/.suo and b/.vs/AAWeb/v15/.suo differ diff --git a/Spaces/FloatingSpace.js b/Spaces/FloatingSpace.js index c5fa8b9e1..68170c126 100644 --- a/Spaces/FloatingSpace.js +++ b/Spaces/FloatingSpace.js @@ -113,6 +113,26 @@ function newFloatingSpace() { ball.currentSpeed.y = ball.currentSpeed.y - .005; } + // Lets put a maximun speed also. + + const MAX_SPEED = 50; + + if (ball.currentSpeed.x > MAX_SPEED) { + ball.currentSpeed.x = MAX_SPEED; + } + + if (ball.currentSpeed.y > MAX_SPEED) { + ball.currentSpeed.y = MAX_SPEED; + } + + if (ball.currentSpeed.x < -MAX_SPEED) { + ball.currentSpeed.x = -MAX_SPEED; + } + + if (ball.currentSpeed.y < -MAX_SPEED) { + ball.currentSpeed.y = -MAX_SPEED; + } + // The radius also have a target. if (ball.currentRadius < ball.targetRadius) {