📜  js 中的网格 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:22.193000             🧑  作者: Mango

代码示例1
var NUM_COLS = 5;
var NUM_ROWS = 4;
for (var i = 0; i < NUM_COLS; i++) {
  for (var j = 0; j < NUM_ROWS; j++) {
    var tileX = i * 54 + 5;
    var tileY = j * 54 + 40;
    tiles.push(new Tile(tileX, tileY));
  }
}