Update life.js

This commit is contained in:
Kyle
2019-08-10 17:10:21 -07:00
parent c0e00ba3bb
commit 332155ef93

View File

@@ -230,7 +230,9 @@ function switchToTouchEvents() {
for (var i = 1; i <= playerCount; i++) { for (var i = 1; i <= playerCount; i++) {
playerList[i - 1].canvas.removeEventListener("mousedown", decoyMouseDownFunction, true) playerList[i - 1].canvas.removeEventListener("mousedown", decoyMouseDownFunction, true)
playerList[i - 1].canvas.addEventListener("touchstart", function() { playerList[i - 1].canvas.addEventListener("touchstart", function() {
mouseDownPlayerBox(this, event.clientX, event.clientY) for (var i = 0; i < event.touches.length; i ++) {
mouseDownPlayerBox(this, event.touches[i].clientX, event.touches[i].clientY)
}
}, true) }, true)
playerList[i - 1].canvas.addEventListener("touchend", function() { playerList[i - 1].canvas.addEventListener("touchend", function() {
mouseUpPlayerBox(this) mouseUpPlayerBox(this)