function startGame() {
    let menu = {
      "": {
        title: "Select Maze Size",
        selected: sizes.indexOf(settings.size || defaultSize),
      },
    };
    sizes.filter(s => s>=minSize).forEach(size => {
      let name = sizeNames[size];
      if (size<minSize) name = "! "+size;
      let cols = Math.round(sW/(size*2.5)),
        rows = Math.round(sH/(size*2.5));
      if (rows<10) rows = " "+rows;
      if (cols<10) cols = " "+cols;
      name += " ".repeat(14-name.length);
      name += `${cols}x${rows}`;
      menu[name] = () => {
        // remember chosen size
        settings.size = size;
        require("Storage").write("ballmaze.json", settings);
        playMaze(size);
      };
    });
    menu["< Exit"] = () => load();
    showMenu(menu);
  }
/**
   * Ask player what size maze they would like to play
   */
Ask player what size maze they would like to play
Ask player what size maze they would like to play
function startGame() {
    let menu = {
      "": {
        title: "Select Maze Size",
        selected: sizes.indexOf(settings.size || defaultSize),
      },
    };
    sizes.filter(s => s>=minSize).forEach(size => {
      let name = sizeNames[size];
      if (size<minSize) name = "! "+size;
      let cols = Math.round(sW/(size*2.5)),
        rows = Math.round(sH/(size*2.5));
      if (rows<10) rows = " "+rows;
      if (cols<10) cols = " "+cols;
      name += " ".repeat(14-name.length);
      name += `${cols}x${rows}`;
      menu[name] = () => {
        settings.size = size;
        require("Storage").write("ballmaze.json", settings);
        playMaze(size);
      };
    });
    menu["< Exit"] = () => load();
    showMenu(menu);
  }
function startGame ( ) { let menu = { "" : { title : "Select Maze Size" , selected : sizes . indexOf ( settings . size || defaultSize ) , } , } ; sizes . filter ( s => s >= minSize ) . forEach ( size => { let name = sizeNames [ size ] ; if ( size < minSize ) name = "! " + size ; let cols = Math . round ( sW / ( size * 2.5 ) ) , rows = Math . round ( sH / ( size * 2.5 ) ) ; if ( rows < 10 ) rows = " " + rows ; if ( cols < 10 ) cols = " " + cols ; name += " " . repeat ( 14 - name . length ) ; name += ` ${ cols } ${ rows } ` ; menu [ name ] = ( ) => { settings . size = size ; require ( "Storage" ) . write ( "ballmaze.json" , settings ) ; playMaze ( size ) ; } ; } ) ; menu [ "< Exit" ] = ( ) => load ( ) ; showMenu ( menu ) ; }
Ask player what size maze they would like to play
Ask player what size maze they would like to play
// remember chosen size