buggy.style.left = "0px";
var x = parseInt(buggy.style.left);
var y = 200
document.addEventListener("keydown", function(event){
console.log(x)
if (event.code === "ArrowLeft"){
x = x-20;
buggy.style.left = x +"px";
buggy.style.backgroundImage = "url('car3.png')"
blinker.play()
}
else if (event.code === "ArrowRight"){
x = x+20;
buggy.style.left = x +"px";
buggy.style.backgroundImage = "url('car4.png')"
blinker.play()
}
else if (event.code === "ArrowUp"){
y = y-20
buggy.style.width = y + "px"
buggy.style.height = y + "px"
buggy.style.backgroundImage = "url('car2.png')"
vroom.play()
blinker.pause()
}
else if (event.code === "ArrowDown"){
y = y+20
buggy.style.width = y + "px"
buggy.style.height = y + "px"
buggy.style.backgroundImage = "url('car1.png')"
start.play()
vroom.play()
blinker.pause()
}
else if (event.code === "Space"){
horn.play()
}
})