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 #466

Merged
merged 2 commits into from
Sep 29, 2022
Merged

complete frogger-game #466

merged 2 commits into from
Sep 29, 2022

Conversation

drewzag
Copy link
Contributor

@drewzag drewzag commented Sep 7, 2022

Frogger Game

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 7, 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 😺

@stale
Copy link

stale bot commented Sep 21, 2022

discarded

@stale stale bot added the 💤 Stale label Sep 21, 2022
@stale stale bot closed this Sep 28, 2022
@OleksiyRudenko
Copy link
Member

OleksiyRudenko commented Sep 28, 2022

See what the bot asked you to do. It is unlikely that the code will be reviewed until you accomplish self-check and fixes and explicitly confirm that you did this.

I just noticed that you have nearly the full-house of submissions. It would be a shame if closed PR would block your progress.

@stale stale bot removed the 💤 Stale label Sep 28, 2022
@drewzag
Copy link
Contributor Author

drewzag commented Sep 29, 2022

My bad, I missed bot's recommendations.

Self-check done!

And I have question about this

Const objects help organizing and structure const data even better, e.g. const PLAYER_CONF = { initialPosition: {x: 1, y: 5}, sprite: '...', ...etc... };

Why is it better? In this case I can accidentally redefine elements in object and don't even get an error

@OleksiyRudenko
Copy link
Member

Const objects help organizing and structure const data even better, e.g. const PLAYER_CONF = { initialPosition: {x: 1, y: 5}, sprite: '...', ...etc... };

Why is it better? In this case I can accidentally redefine elements in object and don't even get an error

It is not better in general. It says "Const objects help organizing and structure const data even better"
Think of big configurations that you have in a dedicated file. Now you want to import config from that file.
Your alternatives can be

// 1
import { GAME_SETTINGS } from `./config.js'

// 2
import { FIELD_SETTINGS, PLAYER_SETTINGS, ENEMY_SETTINGS } from `./config.js'

// 3
import {
FIELD_ROW = 5,
FIELD_COLS = 5,
CELL_X_SIZE = 101,
....
ENEMY_MIN_SPEED,
ENEMY_MAX_SPEED,
....
PLAYER_START_COL,
PLAYER_START_ROW,
PLAYER_SIZE_Y,
...
} from `./config.js'

So just pick what works better for the project, readability and code maintenance.

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.

@drewzag perfect job done!

const allEnemies = []
for (let i = 0; i < 3; i++) {
let count = i
if (i >= 3) {
Copy link
Member

@OleksiyRudenko OleksiyRudenko Sep 29, 2022

Choose a reason for hiding this comment

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

Does this ever happen?
Minor issue.
You may want to fix this in your project repo.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've played more than 3 enemies. I'll fix this!
Thanks for your review)

@OleksiyRudenko OleksiyRudenko merged commit 880fadb into kottans:main Sep 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants