Update life.js

This commit is contained in:
Kyle
2019-10-30 20:37:59 -07:00
parent c59f6f77bd
commit 6f2a01a4d0

View File

@@ -290,7 +290,7 @@ function singleTap(targetPlayerBox) {
console.log("touchX: " + touchX[touchX.length - 1] + "\ntouchY: " + touchY[touchY.length - 1]) console.log("touchX: " + touchX[touchX.length - 1] + "\ntouchY: " + touchY[touchY.length - 1])
if (tappedPlayerBox.rotation == 0 || tappedPlayerBox.rotation == 180) { if (tappedPlayerBox.rotation == 0 || tappedPlayerBox.rotation == 180) {
console.log(touchX[touchX.length - 1]) console.log(touchX[touchX.length - 1])
console.log(playerBoxBounds.width / 2 + playerBoxBounds.x) console.log(playerBoxBounds.width / 2 + playerBoxBounds.left)
if (touchX[touchX.length - 1] > playerBoxBounds.width / 2 + playerBoxBounds.left) { if (touchX[touchX.length - 1] > playerBoxBounds.width / 2 + playerBoxBounds.left) {
lifeAdjust = 1 lifeAdjust = 1
} else { } else {
@@ -298,7 +298,7 @@ function singleTap(targetPlayerBox) {
} }
} else { } else {
console.log(touchY[touchY.length - 1]) console.log(touchY[touchY.length - 1])
console.log(playerBoxBounds.height / 2 + playerBoxBounds.y) console.log(playerBoxBounds.height / 2 + playerBoxBounds.top)
if (touchY[touchY.length - 1] > playerBoxBounds.height / 2 + playerBoxBounds.top) { if (touchY[touchY.length - 1] > playerBoxBounds.height / 2 + playerBoxBounds.top) {
lifeAdjust = 1 lifeAdjust = 1
} else { } else {