-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Develop #999
base: master
Are you sure you want to change the base?
Develop #999
Conversation
NazarHaida
commented
Oct 22, 2024
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.
src/scripts/main.js
Outdated
case 'ArrowLeft': | ||
game.moveLeft(); | ||
moveMade = true; | ||
break; | ||
case 'ArrowRight': | ||
game.moveRight(); | ||
moveMade = true; | ||
break; | ||
case 'ArrowUp': | ||
game.moveUp(); | ||
moveMade = true; | ||
break; | ||
case 'ArrowDown': | ||
game.moveDown(); | ||
moveMade = true; | ||
break; |
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.
Create variables for event key words and use it here, also, add the blank line between the cases
case 'ArrowLeft': | |
game.moveLeft(); | |
moveMade = true; | |
break; | |
case 'ArrowRight': | |
game.moveRight(); | |
moveMade = true; | |
break; | |
case 'ArrowUp': | |
game.moveUp(); | |
moveMade = true; | |
break; | |
case 'ArrowDown': | |
game.moveDown(); | |
moveMade = true; | |
break; | |
case 'ArrowLeft': | |
game.moveLeft(); | |
moveMade = true; | |
break; | |
case 'ArrowRight': | |
game.moveRight(); | |
moveMade = true; | |
break; | |
case 'ArrowUp': | |
game.moveUp(); | |
moveMade = true; | |
break; | |
case 'ArrowDown': | |
game.moveDown(); | |
moveMade = true; | |
break; |
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.
Great work! 🔥