<commit_before>var PIXI = require("../thirdparty/pixi.dev");
var Infinity = require("./Infinity");
var GameContext = require("./GameContext");

function Main() {

    this.gameContext = new GameContext(window.innerWidth, window.innerHeight);
    this.stage = new PIXI.Stage(0x000000);
    this.renderer = new PIXI.autoDetectRenderer(
        this.gameContext.windowWidth,
        this.gameContext.windowHeight,
        document.getElementById("game-canvas")
    );

    this.loadAssets();
}

Main.prototype.update = function() {
    this.infinity.update();

    this.renderer.render(this.stage);
    requestAnimFrame(this.update.bind(this));
};

Main.prototype.loadAssets = function() {
    var assetsToLoad = [
        this.gameContext.backgroundImage,
        "assets/player.png"
    ];
    loader = new PIXI.AssetLoader(assetsToLoad);
    loader.onComplete = this.assetsLoaded.bind(this);
    loader.load();
};<commit_msg>Added preloading of player ship and exhaust<commit_after>var PIXI = require("../thirdparty/pixi.dev");
var Infinity = require("./Infinity");
var GameContext = require("./GameContext");

function Main() {

    this.gameContext = new GameContext(window.innerWidth, window.innerHeight);
    this.stage = new PIXI.Stage(0x000000);
    this.renderer = new PIXI.autoDetectRenderer(
        this.gameContext.windowWidth,
        this.gameContext.windowHeight,
        document.getElementById("game-canvas")
    );

    this.loadAssets();
}

Main.prototype.update = function() {
    this.infinity.update();

    this.renderer.render(this.stage);
    requestAnimFrame(this.update.bind(this));
};

Main.prototype.loadAssets = function() {
    var assetsToLoad = [
        this.gameContext.backgroundImage,
        "assets/player/ship.png",
        "assets/player/exhaust.json"
    ];
    loader = new PIXI.AssetLoader(assetsToLoad);
    loader.onComplete = this.assetsLoaded.bind(this);
    loader.load();
};
{'fraction_non_alphanumeric': 0.13988559542381696, 'fraction_numerical': 0.007280291211648466, 'mean_word_length': 3.5377358490566038, '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': '6455757', 'n_tokens_mistral': 598, 'n_tokens_neox': 581, 'n_words': 91}