Update life.js

This commit is contained in:
Kyle
2019-08-16 14:31:18 -07:00
parent 15a3b08beb
commit b9212e4b30

View File

@@ -91,6 +91,7 @@ function playerBox(playerBoxID, canvasRotation, wide) {
this.canvas = document.createElement("canvas") this.canvas = document.createElement("canvas")
this.direction = "false" this.direction = "false"
this.holdTime = 0 this.holdTime = 0
this.touchIndex = -1
this.color = "#222222" this.color = "#222222"
this.textColor = "#ffffff" this.textColor = "#ffffff"
this.image = new Image() this.image = new Image()
@@ -341,7 +342,6 @@ function switchToTouchEvents() {
window.addEventListener("touchend", endTouch, true) window.addEventListener("touchend", endTouch, true)
} }
function startTouch() { function startTouch() {
console.log("touch started")
moveTouch() moveTouch()
clicking = true clicking = true
singleTap() singleTap()
@@ -354,6 +354,7 @@ function moveTouch() {
} }
} }
function endTouch() { function endTouch() {
console.log(event.target.id + " released")
moveTouch() moveTouch()
if (event.touches.length == 0) { if (event.touches.length == 0) {
clicking = false clicking = false
@@ -370,7 +371,6 @@ function endTouch() {
function singleTap() { function singleTap() {
console.log("a tap has occurred!")
var playerBoxBounds = event.target.getBoundingClientRect() var playerBoxBounds = event.target.getBoundingClientRect()
var tappedPlayerBox = playerList[event.target.customVarID - 1] var tappedPlayerBox = playerList[event.target.customVarID - 1]
var lifeAdjust = 0 var lifeAdjust = 0
@@ -548,4 +548,4 @@ function heldDown() {
loop = setTimeout(heldDown, 100) loop = setTimeout(heldDown, 100)
} }
} }
//Updated for realsies!!! like actually... *SIGH* //Updated for realsies!!! like actually... *SIGH* will it ever work?