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

Complete Frogger Game #484

Merged
merged 2 commits into from
Sep 26, 2022
Merged

Complete Frogger Game #484

merged 2 commits into from
Sep 26, 2022

Conversation

deveLabR
Copy link
Contributor

@deveLabR deveLabR commented Sep 8, 2022

Object-Oriented JavaScript

Demo |
Code base

The code is submitted in a dedicated feature branch.

Only code files are submitted.

Please, review.

@github-actions
Copy link

github-actions bot commented Sep 8, 2022

Hey!

Congratulations on your PR! 😎😎😎

Let's do some self-checks to fix most common issues and to make some improvements to the code before reviewers put their hands on the code.

Go through the requirements/most common mistakes linked below and fix the code as appropriate.

If you have any questions to requirements/common mistakes feel free asking them here or in Students' chat.

When you genuinely believe you are done put a comment stating that you have completed self-checks and fixed code accordingly.

Also, be aware, that if you would silently ignore this recommendation, a mentor can think that you are still working on fixes. And your PR will not be reviewed. 😒

Please, make sure that your code follows the requirements

Universal recommendations:

  • Make sure your code follows General Requirements
  • Use common sense or seek for an advice whenever requirements look ambiguous or unclear.

By the way, you may proceed to the next task before this one is reviewed and merged.

Sincerely yours,
Submissions Kottachecker 😺

@deveLabR
Copy link
Contributor Author

Self-check done.

@OleksiyRudenko OleksiyRudenko added the self-check-done Student confirmed that self-checks against requirements/common-mistakes are done label Sep 20, 2022
Copy link
Member

@OleksiyRudenko OleksiyRudenko left a comment

Choose a reason for hiding this comment

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

@deveLabR more than 1 requirements from those posted/linked by bot are not met.

Please copy/paste the requirements, go through them thoroughly, mark those that are met by the code, ask questions here and/or Students' chat if anything is not clear, fix code accordingly.

Comment on lines 12 to 27
update(dt) {
this.x += this.speed * dt;

if (this.x > 510) {
this.x = -70;
}

if (
player.x + this.width > this.x &&
player.x < this.x + this.width &&
player.y + this.height > this.y &&
player.y < this.y + this.height
) {
player.toStart();
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Requirements posted/linked by bot address two issues with method update specifically.
Please identify those, copy/paste them as a comment in this PR and fix code accrodingly.

@OleksiyRudenko OleksiyRudenko self-assigned this Sep 20, 2022
@deveLabR
Copy link
Contributor Author

If I understood correctly, I need to make corrections according to the following points:

  • All numbers like block dimensions, initial locations are defined as constants.
  • There are core constants and derived (calculated) constants (e.g. const FIELD_WIDTH = BLOCK_WIDTH * BLOCKS_NUMBER;).
  • Separation of Concerns principle is followed (e.g. update method only updates character coordinates and doesn't contain any inline code to check e.g. collisions; calling other methods from update is legitimate).

Did I miss something?

@OleksiyRudenko
Copy link
Member

These are relevant.
There is also yet another one addressing the code in the lines my previous comment is associated with.

@deveLabR
Copy link
Contributor Author

I hope that I understood what is required of me)) now I will try to fix everything

Copy link
Member

@OleksiyRudenko OleksiyRudenko left a comment

Choose a reason for hiding this comment

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

@deveLabR great job!

@OleksiyRudenko OleksiyRudenko merged commit 0d4b3af into kottans:main Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
self-check-done Student confirmed that self-checks against requirements/common-mistakes are done task-Frogger
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants