Update life.js

This commit is contained in:
Kyle
2019-10-30 20:32:57 -07:00
parent ffc836ecb5
commit 1b71e70c58

View File

@@ -289,14 +289,16 @@ function singleTap(targetPlayerBox) {
console.log("Rotation: " + tappedPlayerBox.rotation) console.log("Rotation: " + tappedPlayerBox.rotation)
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("rotation was 0 or 180, right?") console.log(touchX[touchX.length - 1])
console.log(playerBoxBounds.width / 2 + playerBoxBounds.x)
if (touchX[touchX.length - 1] > playerBoxBounds.width / 2 + playerBoxBounds.x) { if (touchX[touchX.length - 1] > playerBoxBounds.width / 2 + playerBoxBounds.x) {
lifeAdjust = 1 lifeAdjust = 1
} else { } else {
lifeAdjust = -1 lifeAdjust = -1
} }
} else { } else {
console.log("rotation was 90 or 270, right?") console.log(touchY[touchY.length - 1])
console.log(playerBoxBounds.height / 2 + playerBoxBounds.y)
if (touchY[touchY.length - 1] > playerBoxBounds.height / 2 + playerBoxBounds.y) { if (touchY[touchY.length - 1] > playerBoxBounds.height / 2 + playerBoxBounds.y) {
lifeAdjust = 1 lifeAdjust = 1
} else { } else {