From d0f985c0e1e264e4ccb9635f7b0d8713951ed25e Mon Sep 17 00:00:00 2001 From: Kyle <41976328+ImKyle4815@users.noreply.github.com> Date: Thu, 15 Aug 2019 18:01:06 -0700 Subject: [PATCH] Update life.js --- data/life/life.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/data/life/life.js b/data/life/life.js index 24b173b6..f6638855 100644 --- a/data/life/life.js +++ b/data/life/life.js @@ -182,9 +182,9 @@ function rollRNG() { document.getElementById("rngOutput").innerHTML = Math.floor(Math.random() * (parseInt(document.getElementById("inputRNGMax").value) - parseInt(document.getElementById("inputRNGMin").value) + 1) + parseInt(document.getElementById("inputRNGMin").value)) } function updatePlayerBoxes() { - alert("did I click?") + // alert("did I click?") if (clicking) { - alert("yes I did!") + // alert("yes I did!") //Make a list of the touch locations for (var i = 0; i < touchX.length; i++) { for (var n = 1; n <= playerList.length; n ++) { @@ -239,8 +239,8 @@ function updatePlayerBoxes() { } } playerList[n - 1].life += lifeAdjust - alert("I clicked on " + n + "!") - alert("Their life total is now " + playerList[n - 1].life) + // alert("I clicked on " + n + "!") + // alert("Their life total is now " + playerList[n - 1].life) drawPlayerBox(n) break } else { @@ -336,10 +336,12 @@ function switchToTouchEvents() { window.addEventListener("touchend", endTouch, true) } function startTouch() { - if (event.touches.length > 0) { - if (!clicking) { - updatePlayerBoxes() + if (!clicking) { + if (event.touches.length > 0) { + clicking = true } + updatePlayerBoxes() + } else if (event.touches.length > 0) { clicking = true } }