We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ade9aaa commit 97abda4Copy full SHA for 97abda4
src/index.js
@@ -706,11 +706,7 @@ function animate() {
706
}
707
708
};
709
-
710
-// canvas.focus();
711
712
-animate();
713
+//
714
window.addEventListener('keydown', ({ key }) => {
715
switch (key) {
716
case 'w':
@@ -751,4 +747,11 @@ window.addEventListener('keyup', ({ key }) => {
751
747
752
748
// window.addEventListener('keydown', handleKeyDown);
753
749
// window.addEventListener('keyup', handleKeyUp);
754
-console.log(pacman.velocity);
750
+console.log(pacman.velocity);
+
+function startGame() {
+ canvas.focus();
+ animate();
755
+};
756
757
+startGame();
0 commit comments