<commit_before>import Controls from './classes/Controls.js';
import Game     from './classes/Game';

let controls = new Controls();
let game     = new Game(controls);

let lastFrameTime = 0;

/**
 * Main game loop
 * @param {number} currentFrameTime Time in seconds
 * @returns {void}
 */
function gameLoop(currentFrameTime) {
    requestAnimationFrame(gameLoop);
    let deltaT = currentFrameTime - lastFrameTime;
    lastFrameTime = currentFrameTime;

    if(controls.enabled) {
        controls.update();
        game.update(deltaT / 1000);
    }

    game.draw();
}

gameLoop();<commit_msg>Only call draw every 10 frames when paused<commit_after>import Controls from './classes/Controls.js';
import Game     from './classes/Game';

let controls = new Controls();
let game     = new Game(controls);

let lastFrameTime = 0;

let frameCounter = 0;

/**
 * Main game loop
 * @param {number} currentFrameTime Time in seconds
 * @returns {void}
 */
function gameLoop(currentFrameTime) {
    requestAnimationFrame(gameLoop);
    let deltaT = currentFrameTime - lastFrameTime;
    lastFrameTime = currentFrameTime;

    if(controls.enabled) {
        controls.update();
        game.update(deltaT / 1000);
        game.draw();
    } else if(frameCounter % 10 == 0) {
        game.draw();
    }

    frameCounter++;
}

gameLoop();
{'fraction_non_alphanumeric': 0.12226415094339622, 'fraction_numerical': 0.012075471698113207, 'mean_word_length': 3.2774193548387096, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '177192', 'n_tokens_mistral': 405, 'n_tokens_neox': 380, 'n_words': 105}