function gameSetup() {
  const gameArea = document.getElementById('game-area-hard');
  const img = new Image();
  //   Board image: Our own picture choice
  img.src = "https://cdn.glitch.me/322c0444-bdb6-400c-8c7b-568c71c6bd72%2Fm.jpg?v=16371733903455";

  img.onload = function() {
    const gameAspectRatio = img.naturalWidth / img.naturalHeight;
    gameArea.style.setProperty('--img-url', `url(${img.src}`);
    gameArea.style.setProperty('--game-aspect-ratio', gameAspectRatio);

    const tileHTML = `<div class="tile" tabindex="0">
          <div class="number">
          </div>
        </div>`;
    const tiles = [...Array(25)].map((_) => tileHTML); // The array is 25 because we want a 5 by 5 puzzle for the hard game

    gameArea.innerHTML = tiles.join('');

    tileSetup();
    drawGame();
    document.getElementById('randomize-button').style.display = 'block';
    document.getElementById('next-button').style.display = 'none';
  };
}
// Set up the board image, dimensions and initialise the tiles
Set up the board image, dimensions and initialise the tiles
Set up the board image dimensions and initialise the tiles
function gameSetup() {
  const gameArea = document.getElementById('game-area-hard');
  const img = new Image();
  img.src = "https://cdn.glitch.me/322c0444-bdb6-400c-8c7b-568c71c6bd72%2Fm.jpg?v=16371733903455";
  img.onload = function() {
    const gameAspectRatio = img.naturalWidth / img.naturalHeight;
    gameArea.style.setProperty('--img-url', `url(${img.src}`);
    gameArea.style.setProperty('--game-aspect-ratio', gameAspectRatio);
    const tileHTML = `<div class="tile" tabindex="0">
          <div class="number">
          </div>
        </div>`;
    const tiles = [...Array(25)].map((_) => tileHTML); 
    gameArea.innerHTML = tiles.join('');
    tileSetup();
    drawGame();
    document.getElementById('randomize-button').style.display = 'block';
    document.getElementById('next-button').style.display = 'none';
  };
}
function gameSetup ( ) { const gameArea = document . getElementById ( 'game-area-hard' ) ; const img = new Image ( ) ; img . src = "https://cdn.glitch.me/322c0444-bdb6-400c-8c7b-568c71c6bd72%2Fm.jpg?v=16371733903455" ; img . onload = function ( ) { const gameAspectRatio = img . naturalWidth / img . naturalHeight ; gameArea . style . setProperty ( '--img-url' , ` ${ img . src } ` ) ; gameArea . style . setProperty ( '--game-aspect-ratio' , gameAspectRatio ) ; const tileHTML = ` ` ; const tiles = [ ... Array ( 25 ) ] . map ( ( _ ) => tileHTML ) ; gameArea . innerHTML = tiles . join ( '' ) ; tileSetup ( ) ; drawGame ( ) ; document . getElementById ( 'randomize-button' ) . style . display = 'block' ; document . getElementById ( 'next-button' ) . style . display = 'none' ; } ; }
Set up the board image, dimensions and initialise the tiles
Set up the board image dimensions and initialise the tiles
//   Board image: Our own picture choice // The array is 25 because we want a 5 by 5 puzzle for the hard game