I am trying to make my function dynamic so I can use the same exact one for mouse and touch. Currently I have:
onTouchesEnded:function (touches) {
movePlayer(this, touches[0], player);
},
onMouseUp: function (event) {
movePlayer(this, event, player);
}
Where I have to pass “touches” to my function for touch and “event” for mouse. What is touches and is there a getter for it?