Skip to content

Commit 64c463a

Browse files
committed
Fix example
1 parent bed5f92 commit 64c463a

File tree

1 file changed

+4
-4
lines changed
  • bootcamp_content/projects/breakout/exercises/bouncy-ball

1 file changed

+4
-4
lines changed

bootcamp_content/projects/breakout/exercises/bouncy-ball/example.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ function updateBallCoordinates() {
1111
ball.left += ball.velocityX
1212
ball.top += ball.velocityY
1313

14-
if (ball.left < 0 + ball.size / 2) {
14+
if (ball.left <= 0 + ball.size / 2) {
1515
ball.velocityX = 1 * ball.speed
1616
}
17-
if (ball.left > 100 - ball.size / 2) {
17+
if (ball.left >= 100 - ball.size / 2) {
1818
ball.velocityX = -1 * ball.speed
1919
}
20-
if (ball.top < 0 + ball.size / 2) {
20+
if (ball.top <= 0 + ball.size / 2) {
2121
ball.velocityY = 1 * ball.speed
2222
}
23-
if (ball.top > 100 - ball.size / 2) {
23+
if (ball.top >= 100 - ball.size / 2) {
2424
ball.velocityY = -1 * ball.speed
2525
}
2626
return true

0 commit comments

Comments
 (0)