Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adding the OOP platformer project to new JS curriculum #50385

Draft
wants to merge 29 commits into
base: main
Choose a base branch
from

Conversation

jdwilkin4
Copy link
Contributor

Checklist:

Closes #XXXXX

@jdwilkin4 jdwilkin4 self-assigned this May 15, 2023
@github-actions github-actions bot added platform: learn UI side of the client application that needs familiarity with React, Gatsby etc. scope: curriculum Lessons, Challenges, Projects and other Curricular Content in curriculum directory. scope: i18n language translation/internationalization. Often combined with language type label labels May 15, 2023
@codesee-maps
Copy link
Contributor

codesee-maps bot commented May 15, 2023

👀 Review this PR in a CodeSee Review Map

View the CodeSee Map of this change

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

Copy link
Contributor

@Dario-DC Dario-DC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey Jessica, I know it's a draft, anyway I went through the steps and left some comments.


# --description--

In this project, you are going to learn intermediate Object Oriented principles by building a platformer game. All of the HTML and CSS has been provided for you.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add "Programming" in "intermediate Object Oriented principles".

You should create a `const` variable called `gravity` and assign it 0.5

```js
assert.match(code, /const\s+gravity\s*=\s*0\.5/);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think of changing the regex into /const\s+gravity\s*=\s*0?\.5/ so even const gravity = .5 passes the test?


The next step is to add the logic for increasing or decreasing a player's velocity based on if they move to the left or right of the screen.

Inside the `animate` function, create an `if` statement where the condition checks if the right key was pressed and the player's position is less than 400.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's obvious but maybe it could be specified "player's x position". At least in the hint.


# --hints--

Your `movePlayer` function should have three parameters called `key`, `xVelocity`, `isPressed`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this has to be the only hint I would change it into:
You should create a movePlayer arrow function that has three parameters called key, xVelocity, isPressed.

You should have an `if` statement that checks if the `isCheckpointCollisionDetectionActive` is false.

```js
assert.match(code, /if\s*\(\s*!?\s*isCheckpointCollisionDetectionActive\s*\)\s*{\s*}\s*/);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test passes even if isCheckpointCollisionDetectionActive is true. Also, should we allow something like isCheckpointCollisionDetectionActive === false to pass?

You should have a `checkpoint` parameter inside the `forEach` callback function.

```js
assert.match(code, /\s*checkpoints\s*\.\s*forEach\s*\(\s*checkpoint\s*=>\s*{/s);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test passes without adding code.


# --hints--

You should have a `forEach` loop that iterates through the `checkpoints` array.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This passes without adding code.


You should use the `checkpoint` parameter inside the `forEach` callback function.

```js
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This passes without adding code.


# --description--

Inside the `showCheckpointScreen` function, set the `checkpointScreen` display property to block.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would wrap display in backticks.

You should have a `forEach` loop that iterates through the `checkpoints` array.

```js
assert.match(code, /\bcheckpoints\b\s*\.\s*forEach\s*\(/s);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This passes without adding code.

@ojeytonwilliams ojeytonwilliams mentioned this pull request Sep 12, 2023
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
front 3 2023 platform: learn UI side of the client application that needs familiarity with React, Gatsby etc. scope: curriculum Lessons, Challenges, Projects and other Curricular Content in curriculum directory. scope: i18n language translation/internationalization. Often combined with language type label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants