Necesito ayuda con mi código; Necesito un contador que, cuando hago clic en el botón, y cuando fallo me gustaría puntos negativos. Soy muy nuevo en la codificación y necesito ayuda. Por favor, responda si tiene tiempo.
function update(e) { var x = e.clientX || e.touches[0].clientX var y = e.clientY || e.touches[0].clientY document.documentElement.style.setProperty('--cursorX', x + 'px') document.documentElement.style.setProperty('--cursorY', y + 'px') } document.addEventListener('mousemove', update) document.addEventListener('touchmove', update) function jump() { var x = Math.round((Math.random() * 101)) + "%", y = Math.round((Math.random() * 101)) + "%"; document.getElementById("jump").style.left = x; document.getElementById("jump").style.top = y; } body { background-color: #21096b; font-size: 30px; text-align: center; } body { margin: 0; } .button-container { position: relative; width: calc(100vw - 100px); height: calc(100vh - 20px); } button { position: absolute; width: 20px; height: 20px; } } <div class="button-container"> <button id="jump" onclick="jump()"></button> </div>