Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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;
};
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;
};