Merge pull request #3 from NameWjp/patch-2

简化 getItemsByType 方法
This commit is contained in:
PASSER-BY 2021-03-31 17:47:55 +08:00 committed by GitHub
commit ed97bc2232
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 4 deletions

View File

@ -266,9 +266,7 @@ function Game(id,params){
//获取对象列表
Stage.prototype.getItemsByType = function(type){
return this.items.filter(function(item){
if(item.type==type){
return item;
}
return item.type == type;
});
};
//添加地图

View File

@ -926,7 +926,7 @@
update:function(){
var coord = this.coord;
if(!coord.offset){
if(this.control.orientation!='undefined'){
if(typeof this.control.orientation != 'undefined'){
if(!map.get(coord.x+_COS[this.control.orientation],coord.y+_SIN[this.control.orientation])){
this.orientation = this.control.orientation;
}