window.addEventListener('keydown', (e) => {
switch(e.key) {
case ‘a’:
this.x -= this.velX;
break;
case ‘d’:
this.x += this.velX;
break;
case ‘w’:
this.y -= this.velY;
break;
case ‘s’:
this.y += this.velY;
break;
}
})
why is this code block placed inside the constructor code block