-
-
Notifications
You must be signed in to change notification settings - Fork 184
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
completed frogger-task #519
Conversation
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:
By the way, you may proceed to the next task before this one is reviewed and merged. Sincerely yours, |
dear bot, dear mentors. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sofiichuk nice start.
Needs improvements.
Pixel values are definitely calculable based on icons dimensions and playfield row numbers.
This would require certain research.
For example, how did you come up with numbers for initialPlayerPosition
?
Also how river height is different from cell height?
How did you determine field width and height?
if (player.x <= this.x + character.width && | ||
player.x + character.width >= this.x && | ||
player.y <= this.y + character.height && | ||
player.y + character.height >= this.y) { | ||
player.reset() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Item 4.iii of the requirements.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replaced global variable's properties with enemy's own
const enemy1 = new Enemy(0, 225, 100); | ||
const enemy2 = new Enemy(0, 142, 200); | ||
const enemy3 = new Enemy(0, 60, 150); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mystery numbers. Item 3 (all subitems) of the requirements.
Also not DRY. Imagine you are tasked to add 10 more enemies. Minimize the effort.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no more mystery numbers.
no mo repetitions.
p.s. also fixed two bugs that had been found during UAT.
p.p.s. please, review .this once again
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sofiichuk global variables seem to be supernatural... while they are not.
this.width = character.width; | ||
this.height = character.height; | ||
this.speed = speed; | ||
this.rival = player; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
player
is still a global variable.
What blocks you from treating in the same way as you treat speed or coordinates?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sofiichuk great job!
Object Oriented JS
Demo |
Code base
The code is submitted in a dedicated feature branch.
Only code files are submitted.
Please, review.