// handle inputs on keydown events
const keyPressed = (evt) => {
    // evt.preventDefault()
    console.log(evt.keyCode)
    // resetCanvasToBlack()
    // up
    if (evt.keyCode == 87) {
        paddleY -= paddleSpeed
      }
    else if (evt.keyCode == 83) {
    paddleY+= paddleSpeed
    }

    else if (evt.keyCode == 38) {
      paddle2Y -= paddleSpeed
    }
    //down
    else if (evt.keyCode == 40) {
      paddle2Y += paddleSpeed
    } else {
      console.log("keyCode binding is not defined")
    }
  }
  
  document.addEventListener('keydown', keyPressed)