Dodger game with eventListener
-
Hello everyone I’m practicing eventListener() with This dodger game how ever when I try to move the dodger to the right side without going off the container(The dodger width is 40px) it doesn’t work here is my codepen https://codepen.io/bluesky1992-web/pen/PoeLrzJ[^] any hint will be greatly appreciated .
-
Hello everyone I’m practicing eventListener() with This dodger game how ever when I try to move the dodger to the right side without going off the container(The dodger width is 40px) it doesn’t work here is my codepen https://codepen.io/bluesky1992-web/pen/PoeLrzJ[^] any hint will be greatly appreciated .
You don't have the game object being defined. You should have a
const game = document.getElementById("game");
in there. There's also a syntax error ofconst const
causing problems. Once you definegame
you should see it working as expected.Jeremy Falcon