PMayhem Posted December 12, 2014 Report Share Posted December 12, 2014 Is this at all possible? I originally managed to achieve the effect when I loaded in the background as one single image. But now I'm using tilemaps and adding to a layer with addTilesetImage I can't seem to get any movement there. It's just a simple x -= 0.5; //When moving rightx += 0.5; //When moving left Here's how I'm currently loading the background layer:game.load.image('sky', 'assets/parallax-bg.png');game.load.tilemap('map', 'assets/tilemaps/level1.json', null, Phaser.Tilemap.TILED_JSON);this.map = this.add.tilemap('map');this.map.addTilesetImage('background_spritesheet', 'sky');bgtile = this.map.createLayer('backgroundLayer'); Then I've tried the following in the update() within my if(cursors.left.isDown) to try and get some movementbgtile.tilePosition.x += 0.5; Oh, and here's a link of the WIP if anyone's interested!http://projectmayhem.co.uk/sandbox/santa/santa.html Quote Link to comment Share on other sites More sharing options...
Tam Posted December 12, 2014 Report Share Posted December 12, 2014 bgtile.scrollFactorX = 1.15;See http://docs.phaser.io/Phaser.TilemapLayer.html#scrollFactorX Quote Link to comment Share on other sites More sharing options...
PMayhem Posted December 12, 2014 Author Report Share Posted December 12, 2014 Legend! Thank you!!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.