I\'m using phaser.js to make a game and I cannot find any tutorials on how to make the background scroll infinitely. I\'d like the background to tile/repeat sideways, and in
This can be done with a tile sprite and by moving "tilePosition":
var bgtile;
function preload () {
game.load.image('bgtile', 'bgtile.jpg');
}
function create () {
bgtile = game.add.tileSprite(0, 0, game.stage.bounds.width, game.cache.getImage('bgtile').height, 'bgtile');
}
function update () {
bgtile.tilePosition.x -= 1;
}