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

2048 #572

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

2048 #572

wants to merge 2 commits into from

Conversation

antonshtef
Copy link

[DEMO LINK](https://
antonshtef.github.io/js_2048_game/)

@TarasHoliuk
Copy link

  1. Arrow buttons should start working only after Start button click
Screencast.from.12-11-23.15.13.49.webm
  1. The logic of arrow button listener is broken, on the video I clicked left arrow
    Screencast from 12-11-23 15:17:54.webm

  2. On this video I clicked "down" button - cells didn't merge - logic is broken. Also new cells should not appear if no one of current cell moved or merged after arrow click:
    Screencast from 12-11-23 15:19:32.webm

Copy link

@TarasHoliuk TarasHoliuk left a 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

}

document.addEventListener('keyup', type => {
switch (startBtn.classList.contains('restart')) {

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

Suggested change
switch (startBtn.classList.contains('restart')) {
switch (event.code) {

return false;
}

document.addEventListener('keyup', type => {

Choose a reason for hiding this comment

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

Suggested change
document.addEventListener('keyup', type => {
document.addEventListener('keyup', event => {

Copy link

@VitaliyBondarenko1982 VitaliyBondarenko1982 left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants