function init() {
    sizingGameBoards()
    if (!snake) {
        snake = new Snake({ initialPosition: { x: snakeboard.width / 4, y: snakeboard.height / 2 }, initialTileSize: 10 });
    }
    renderStaticBackground(bgStatic_ctx);
    // pre-generate food items
    foods.forEach(f => f.new(generatedItemBox));
    // render snake object for the first-time; it'll be updated during gameLoop
    snake.render(snakeboard_ctx);
}
/**
 * this function is called at first-load to set up initial contents
 * it's also called every time window size is changed (e.g, user resizes browser)
 */
this function is called at first-load to set up initial contents
it's also called every time window size is changed
this function is called at first - load to set up initial contents it ' s also called every time window size is changed
function init() {
    sizingGameBoards()
    if (!snake) {
        snake = new Snake({ initialPosition: { x: snakeboard.width / 4, y: snakeboard.height / 2 }, initialTileSize: 10 });
    }
    renderStaticBackground(bgStatic_ctx);
    foods.forEach(f => f.new(generatedItemBox));
    snake.render(snakeboard_ctx);
}
function init ( ) { sizingGameBoards ( ) if ( ! snake ) { snake = new Snake ( { initialPosition : { x : snakeboard . width / 4 , y : snakeboard . height / 2 } , initialTileSize : 10 } ) ; } renderStaticBackground ( bgStatic_ctx ) ; foods . forEach ( f => f . new ( generatedItemBox ) ) ; snake . render ( snakeboard_ctx ) ; }
this function is called at first-load to set up initial contents
 it's also called every time window size is changed (e.g, user resizes browser)
this function is called at first - load to set up initial contents it ' s also called every time window size is changed ( e . g user resizes browser )
// pre-generate food items // render snake object for the first-time; it'll be updated during gameLoop