updated 修改游戏碰撞事件

This commit is contained in:
郑浩乐
2016-01-08 11:22:01 +08:00
parent 8848cbf001
commit 1401c8c861
2 changed files with 8 additions and 12 deletions

View File

@@ -242,10 +242,9 @@ function Game(id,options){
return item;
};
//获取对象列表
Stage.prototype.getItemsByType = function(){
var types = Array.prototype.slice.call(arguments,0);
Stage.prototype.getItemsByType = function(type){
var items = this.items.filter(function(item){
if(types.indexOf(item.type)>-1){
if(item.type==type){
return item;
}
});