Как сделать, чтобы два игрока могли двигаться одновременно?
window.addEventListener('keydown', function(e){
if(e.keyCode == 38){
let goUp = firstSquare.offsetTop;
firstSquare.style.top = goUp - 10 + "px";
}
if(e.keyCode == 40){
let goDown = firstSquare.offsetTop
firstSquare.style.top = goDown + 10 + "px"
}
if(e.keyCode == 37){
let goLeft = firstSquare.offsetLeft
firstSquare.style.left = goLeft - 10 + "px"
}
if(e.keyCode == 39){
let goRight = firstSquare.offsetLeft
firstSquare.style.left = goRight + 10 + "px"
}
if(e.keyCode == 87){
let moveUp = secondSquare.offsetTop;
secondSquare.style.top = moveUp - 10 + "px";
}
if(e.keyCode == 83){
let moveDown = secondSquare.offsetTop
secondSquare.style.top = moveDown + 10 + "px"
}
if(e.keyCode == 65){
let moveLeft = secondSquare.offsetLeft
secondSquare.style.left = moveLeft - 10 + "px"
}
if(e.keyCode == 68){
let moveRight = secondSquare.offsetLeft
secondSquare.style.left = moveRight + 10 + "px"
}
})