updated js简写

This commit is contained in:
mumuy 2022-03-04 14:00:17 +08:00
parent d41a5fd4ee
commit 3a234f4f1b

View File

@ -156,10 +156,7 @@ function Game(id,params){
var result = []; var result = [];
var y_length = options.map.length; var y_length = options.map.length;
var x_length = options.map[0].length; var x_length = options.map[0].length;
var steps = []; //步骤的映射 var steps = Array(y_length).fill(0).map(()=>Array(x_length).fill(0)); //步骤的映射
for(var y=y_length;y--;){
steps[y] = new Array(x_length).fill(0);
}
var _getValue = function(x,y){ //获取地图上的值 var _getValue = function(x,y){ //获取地图上的值
if(options.map[y]&&typeof options.map[y][x]!='undefined'){ if(options.map[y]&&typeof options.map[y][x]!='undefined'){
return options.map[y][x]; return options.map[y][x];