Skip to content

Commit 97045bf

Browse files
authored
fix(curriculum) allow space, update wording, include position prop in hints (freeCodeCamp#55832)
1 parent 59a2eac commit 97045bf

File tree

1 file changed

+12
-12
lines changed
  • curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-intermediate-oop-by-building-a-platformer-game

1 file changed

+12
-12
lines changed

curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-intermediate-oop-by-building-a-platformer-game/64cb2e5bdfb23a67272a07c7.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ dashedName: step-98
99

1010
Now you need to create a `draw` method for the `CheckPoint` class.
1111

12-
Inside the `draw` method, add a `fillStyle` property to the `ctx` object and set it to `"#f1be32"`.
12+
Inside the `draw` method, assign the `fillStyle` property on the `ctx` object the hex color `"#f1be32"`.
1313

1414
Below the `fillStyle` property, use the `fillRect` method on the `ctx` object and pass in the `x`, `y`, `width`, and `height` properties as arguments.
1515

@@ -18,35 +18,35 @@ Below the `fillStyle` property, use the `fillRect` method on the `ctx` object an
1818
Your `CheckPoint` class should have a `draw` method.
1919

2020
```js
21-
const splitter = code.split("ctx.fillRect(this.position.x, this.position.y, this.width, this.height)")
22-
assert.match(splitter[2], /draw\(\s*\)\s*\{/);
21+
const splitter = code.split("ctx.fillRect(this.position.x, this.position.y, this.width, this.height)");
22+
assert.match(splitter[2], /draw\s*\(\s*\)\s*\{/);
2323
```
2424

25-
Your `draw` method should have a `fillStyle` property added to the `ctx` object.
25+
Your `draw` method should assign a value to the `fillStyle` property on the `ctx` object.
2626

2727
```js
28-
const splitter = code.split("ctx.fillRect(this.position.x, this.position.y, this.width, this.height)")
29-
assert.match(splitter[2], /draw\(\s*\)\s*\{\s*ctx\.fillStyle/);
28+
const splitter = code.split("ctx.fillRect(this.position.x, this.position.y, this.width, this.height)");
29+
assert.match(splitter[2], /draw\s*\(\s*\)\s*\{\s*ctx\.fillStyle\s*=/);
3030
```
3131

32-
You should assign `"#f1be32"` to the `ctx.fillStyle` property.
32+
You should assign the hex color `"#f1be32"` to the `fillStyle` property on the `ctx` object.
3333

3434
```js
35-
const splitter = code.split("ctx.fillRect(this.position.x, this.position.y, this.width, this.height)")
36-
assert.match(splitter[2], /draw\(\s*\)\s*\{\s*ctx\.fillStyle\s*=\s*('|")#f1be32\1\s*;?/);
35+
const splitter = code.split("ctx.fillRect(this.position.x, this.position.y, this.width, this.height)");
36+
assert.match(splitter[2], /draw\s*\(\s*\)\s*\{\s*ctx\.fillStyle\s*=\s*('|")#f1be32\1\s*;?/);
3737
```
3838

3939
Your `draw` method should invoke the `fillRect` method on the `ctx` object.
4040

4141
```js
42-
const splitter = code.split('#f1be32')
42+
const splitter = code.split('#f1be32');
4343
assert.match(splitter[1], /ctx\.fillRect\(/);
4444
```
4545

46-
When invoking `ctx.fillRect` you should pass in the `x`, `y`, `width`, and `height` properties as arguments. Don't forget the `this` keyword.
46+
When invoking `ctx.fillRect` you should pass in the `position.x`, `position.y`, `width`, and `height` properties as arguments. Don't forget the `this` keyword.
4747

4848
```js
49-
const splitter = code.split('#f1be32')
49+
const splitter = code.split('#f1be32');
5050
assert.match(splitter[1], /ctx\.fillRect\(\s*this\.position\.x\s*,\s*this\.position\.y\s*,\s*this\.width\s*,\s*this\.height\s*\)\s*;?/);
5151
```
5252

0 commit comments

Comments
 (0)