Skip to content

Commit bb4b4d2

Browse files
committed
More speed!
1 parent dab9cef commit bb4b4d2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

bootcamp_content/projects/breakout/exercises/hot-zones/example.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ function handleBallPaddleInteraction() {
6060
const speedYModifier = 0.5 + 1.5 * distancePercentage
6161

6262
ball.velocityY = -Math.max(
63-
Math.min(1.5, Math.abs(ball.velocityY) * speedYModifier),
63+
Math.min(2, Math.abs(ball.velocityY) * speedYModifier),
6464
0.5
6565
)
6666

bootcamp_content/projects/breakout/exercises/hot-zones/introduction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ In this exercise we start to treat the speed on the x axis (left-right) and on t
2222
- If the center of the ball hits the center of the paddle, it should reduce its vertical speed by half.
2323
- If the center of the ball hits the edge of the paddle, it should increase its vertical speed by half.
2424
- If it hits anywhere between those points, it should change its vertical speed as a percentage of its existing speed in a linear manner (i.e. if it hits half way between center and the left edge, it would keep the same speed. If it hits a little to the left of that, it would speed up slightly. If it hits a little to the right, it would slow down slightly).
25-
- The vertical speed should never go above 1.5.
25+
- The vertical speed should never go above 2.
2626
- The vertical speed should never go below 0.5.
2727

2828
**Horizontal Speeds**

0 commit comments

Comments
 (0)