感觉callback函数改成这样:
callback: function (accelEvent, event) {
if (Math.abs(this.speed.x) > Math.abs(this.speed.y)) {
this.speed.x = accelEvent.x
this.speed.y = 0
}
else {
this.speed.x = 0
this.speed.y = accelEvent.y
}
}
应该可以吧
感觉callback函数改成这样:
callback: function (accelEvent, event) {
if (Math.abs(this.speed.x) > Math.abs(this.speed.y)) {
this.speed.x = accelEvent.x
this.speed.y = 0
}
else {
this.speed.x = 0
this.speed.y = accelEvent.y
}
}
应该可以吧