Skip to content

Commit

Permalink
Update van.md
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewgryan authored May 25, 2024
1 parent 951ed18 commit 4701d83
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions docs/content/articles/van.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,17 @@ Bouncing off a paddle however is different. The angle that the ball leaves the p

### Scoring

Scoring is another kind of collision, if either of the vertical boundaries are collided with then the opposite players score counter is incremented and the ball is placed back into the field of play or a game over state is reached.
Scoring is based on collision detection.
If either of the vertical boundaries are collided with then the opposite players score counter is incremented and the ball is placed back into the field of play or a game over state is reached.

```js
if (final.x > right.x) {
if (final.x > rightWall.x) {
score.playerOne += 1
resetBall()
}
if (final.x < leftWall.x) {
score.playerTwo += 1
resetBall()
}
```

Expand Down

0 comments on commit 4701d83

Please sign in to comment.