-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
2048 #572
base: master
Are you sure you want to change the base?
2048 #572
Conversation
Screencast.from.12-11-23.15.13.49.webm
|
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.
Currently, it doesn't work as expected
If you have questions or need help feel free to ask in the chat
src/scripts/main.js
Outdated
} | ||
|
||
document.addEventListener('keyup', type => { | ||
switch (startBtn.classList.contains('restart')) { |
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.
startBtn.classList.contains('restart')
- it should be inside if
switch (startBtn.classList.contains('restart')) { | |
switch (event.code) { |
src/scripts/main.js
Outdated
return false; | ||
} | ||
|
||
document.addEventListener('keyup', type => { |
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.
document.addEventListener('keyup', type => { | |
document.addEventListener('keyup', event => { |
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.
Well done.
Just pay attention and try to fix one issue before prepare project for portfolio.
- When no any cells for merge and no any cells for move - new cell shouldn't appear.
[DEMO LINK](https://
antonshtef.github.io/js_2048_game/)