Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. JavaScript
  4. Dodger game with eventListener

Dodger game with eventListener

Scheduled Pinned Locked Moved JavaScript
game-devdocker
2 Posts 2 Posters 7 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Ali Ibrahim jasim
    wrote on last edited by
    #1

    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 .

    J 1 Reply Last reply
    0
    • A Ali Ibrahim jasim

      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 .

      J Offline
      J Offline
      Jeremy Falcon
      wrote on last edited by
      #2

      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 of const const causing problems. Once you define game you should see it working as expected.

      Jeremy Falcon

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups