How to use the level/config.themes function in level

To help you get started, we’ve selected a few level examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github devyumao / super-ginger / src / level / ground / Background.js View on Github external
Background.prototype._init = function () {
        var game = this.game;

        var imageName = 'bg-' + this.index;
        var image = game.add.tileSprite(
            0, 0,
            game.cache.getImage(imageName).width, game.height,
            imageName
        );
        this.image = image;
        image.tilePosition.x -= config.themes[this.index].offset;
        // image.alpha = 0.8;
    };
github devyumao / super-ginger / src / level / ground / Midground.js View on Github external
Midground.prototype._init = function () {
        var game = this.game;

        var imageName = this.imagePrefix + '-' + this.index;
        var image = game.add.tileSprite(
            0, 0,
            game.cache.getImage(imageName).width, game.height,
            imageName
        );
        this.image = image;
        image.tilePosition.x -= config.themes[this.index].offset;
        // image.alpha = 0.8;
    };