Skip to content

Commit f57893d

Browse files
committed
Section 22: Drawing the Playing Ball
1 parent ff40f59 commit f57893d

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

22-Javascript-with-the-Canvas-API/02-Maze copy/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ verticals.forEach((row, rowIndex) => {
165165
})
166166
})
167167

168+
// Goal
168169
const goal = Bodies.rectangle(
169170
width - unitLength / 2,
170171
height - unitLength / 2,
@@ -175,3 +176,11 @@ const goal = Bodies.rectangle(
175176
}
176177
)
177178
World.add(world, goal)
179+
180+
// Ball
181+
const ball = Bodies.circle(
182+
unitLength / 2,
183+
unitLength / 2,
184+
unitLength / 4
185+
)
186+
World.add(world, ball)

22-Javascript-with-the-Canvas-API/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,6 @@ console.log(grid)
7979

8080
## 20. 24 Drawing Vertical Segments
8181

82-
## 21. 25 Drawing the Goal
82+
## 21. 25 Drawing the Goal
83+
84+
## 22. 26 Drawing the Playing Ball

0 commit comments

Comments
 (0)