$(document).keyup(function(e) {
let points = 0
if (e.key === "ArrowDown") {
points += 10
}
})
var timer;
var points = 0;
var released = true;
$(document).keydown(function(e) {
if(released === true) {
released = false;
clearInterval(timer);
timer = setInterval(function() {
points += 10;
console.log(points)
}, 1000);
}
})
$(document).keyup(function(e) {
released = true;
clearInterval(timer);
let points = 0
if (e.key === "ArrowDown") {
points += 10
}
})