Skip to content

Commit

Permalink
updated 方法简化
Browse files Browse the repository at this point in the history
  • Loading branch information
mumuy committed Jan 17, 2018
1 parent f9fdc18 commit 3de2767
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions game.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,7 @@ function Game(id,params){
var item = new Item(options);
//动态属性
if(item.location){
var position = item.location.coord2position(item.coord.x,item.coord.y);
item.x = position.x;
item.y = position.y;
Object.assign(item,item.location.coord2position(item.coord.x,item.coord.y));
}
//关系绑定
item._stage = this;
Expand All @@ -261,9 +259,7 @@ function Game(id,params){
this.items.forEach(function(item,index){
Object.assign(item,item._settings,item._params);
if(item.location){
var position = item.location.coord2position(item.coord.x,item.coord.y);
item.x = position.x;
item.y = position.y;
Object.assign(item,item.location.coord2position(item.coord.x,item.coord.y));
}
});
};
Expand Down

0 comments on commit 3de2767

Please sign in to comment.