upated bug修复

This commit is contained in:
PASSER-BY 2022-07-10 15:23:06 +08:00
parent 29a2728b94
commit 2bbaa5f58c
2 changed files with 20 additions and 20 deletions

View File

@ -84,7 +84,6 @@ function Game(id,params){
Item.prototype.bind = function(eventType,callback){
if(!_events[eventType]){
_events[eventType] = {};
}
$canvas.addEventListener(eventType,function(e){
var position = _.getPosition(e);
_stages[_index].items.forEach(function(item){
@ -97,6 +96,7 @@ function Game(id,params){
});
e.preventDefault();
});
}
_events[eventType]['s'+this._stage.index+'i'+this._id] = callback.bind(this); //绑定作用域
};
//地图对象构造器
@ -310,7 +310,6 @@ function Game(id,params){
Stage.prototype.bind = function(eventType,callback){
if(!_events[eventType]){
_events[eventType] = {};
}
window.addEventListener(eventType,function(e){
var key = 's' + _index;
if(_events[eventType][key]){
@ -318,6 +317,7 @@ function Game(id,params){
}
e.preventDefault();
});
}
_events[eventType]['s'+this.index] = callback.bind(this); //绑定事件作用域
};
//动画开始