From 3a234f4f1b17e6ff80473fce34cfe87501cf27b2 Mon Sep 17 00:00:00 2001 From: mumuy Date: Fri, 4 Mar 2022 14:00:17 +0800 Subject: [PATCH] =?UTF-8?q?updated=20js=E7=AE=80=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/game.js b/game.js index 99a9c29..588a7f7 100644 --- a/game.js +++ b/game.js @@ -156,10 +156,7 @@ function Game(id,params){ var result = []; var y_length = options.map.length; var x_length = options.map[0].length; - var steps = []; //步骤的映射 - for(var y=y_length;y--;){ - steps[y] = new Array(x_length).fill(0); - } + var steps = Array(y_length).fill(0).map(()=>Array(x_length).fill(0)); //步骤的映射 var _getValue = function(x,y){ //获取地图上的值 if(options.map[y]&&typeof options.map[y][x]!='undefined'){ return options.map[y][x];