updated 添加布景更新方法,当玩家与NPC相遇时暂停布景
This commit is contained in:
6
game.js
6
game.js
@@ -200,6 +200,7 @@ function Game(id,options){
|
||||
var fn = function(){
|
||||
_context.clearRect(0,0,_.width,_.height); //清除画布
|
||||
f++;
|
||||
stage.update();
|
||||
if(stage.map){
|
||||
stage.map.update();
|
||||
stage.map.draw(_context);
|
||||
@@ -241,9 +242,10 @@ function Game(id,options){
|
||||
return item;
|
||||
};
|
||||
//获取对象列表
|
||||
Stage.prototype.getItemsByType = function(type){
|
||||
Stage.prototype.getItemsByType = function(){
|
||||
var types = Array.prototype.slice.call(arguments,0);
|
||||
var items = this.items.filter(function(item){
|
||||
if(item.type==type){
|
||||
if(types.indexOf(item.type)>-1){
|
||||
return item;
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user