updated 微调
This commit is contained in:
parent
c183cf629f
commit
419d4a3a95
4
game.js
4
game.js
@ -198,7 +198,6 @@ function Game(id,params){
|
|||||||
};
|
};
|
||||||
//重置物体位置
|
//重置物体位置
|
||||||
Stage.prototype.resetItems = function(){
|
Stage.prototype.resetItems = function(){
|
||||||
this.status = 1;
|
|
||||||
this.items.forEach(function(item,index){
|
this.items.forEach(function(item,index){
|
||||||
_extend(item,item._settings,item._params);
|
_extend(item,item._settings,item._params);
|
||||||
item.index = index;
|
item.index = index;
|
||||||
@ -212,7 +211,6 @@ function Game(id,params){
|
|||||||
};
|
};
|
||||||
//重置地图
|
//重置地图
|
||||||
Stage.prototype.resetMaps = function(){
|
Stage.prototype.resetMaps = function(){
|
||||||
this.status = 1;
|
|
||||||
this.maps.forEach(function(map){
|
this.maps.forEach(function(map){
|
||||||
_extend(map,map._settings,map._params);
|
_extend(map,map._settings,map._params);
|
||||||
map.data = JSON.parse(JSON.stringify(map._params.data));
|
map.data = JSON.parse(JSON.stringify(map._params.data));
|
||||||
@ -339,6 +337,7 @@ function Game(id,params){
|
|||||||
this.setStage = function(index){
|
this.setStage = function(index){
|
||||||
_stages[_index].status = 0;
|
_stages[_index].status = 0;
|
||||||
_index = index;
|
_index = index;
|
||||||
|
_stages[_index].status = 1;
|
||||||
return _stages[_index];
|
return _stages[_index];
|
||||||
};
|
};
|
||||||
//下个布景
|
//下个布景
|
||||||
@ -346,6 +345,7 @@ function Game(id,params){
|
|||||||
if(_index<_stages.length-1){
|
if(_index<_stages.length-1){
|
||||||
_stages[_index].status = 0;
|
_stages[_index].status = 0;
|
||||||
_index++;
|
_index++;
|
||||||
|
_stages[_index].status = 1;
|
||||||
return _stages[_index];
|
return _stages[_index];
|
||||||
}else{
|
}else{
|
||||||
throw new Error('unfound new stage.');
|
throw new Error('unfound new stage.');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user