-
-
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
Frogger-api-task #532
Frogger-api-task #532
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, |
I've completed self-checks, did'nt find any common errors |
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.
@Conversee12 good job. Although further improvements are required.
The comments below refer items from the requirements
if (this.x < player.x + 80 && this.y < player.y + 60 && this.x + 80 > player.x && this.y + 60 > player.y) { | ||
setTimeout(function () { | ||
player.x = 202; | ||
player.y = 400; |
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.
Also item 3 (all subitems) of the requirements.
}; | ||
|
||
let allEnemies = []; | ||
let eachEnemies = [56, 140, 223]; |
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 (all subitems) of the requirements
player.x = 202; | ||
player.y = 400; |
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. Also why refer to class properties via class instance in the context of class definition?
Also item 3 (all subitems) of the requirements.
Also repetition (item 2 of the requirements).
I hope i understood correctly this changes |
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.
@Conversee12
Feel free asking questions if anything is not clear
if (this.x < player.x + PlayerWidth && this.y < player.y + PlayerHeight && this.x + PlayerWidth > player.x && this.y + PlayerHeight > player.y) { | ||
setTimeout(function () { | ||
player.x = InitialPosition_X; | ||
player.y = InitialPosition_Y; |
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 a global variable. 4.iii provides a hint on how to fix the issue.
Check what makes arrow functions different from regular functions. |
Read an article about this; understood and corrected |
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.
@Conversee12 great job!
frogger-api-task
Demo |
Code base
The code is submitted in a dedicated feature branch.
Only code files are submitted.
Please, review.