this code tilling background top bottom. however, tilling background straight camera view. technique need use achieving it?
preload: function() { this.game.load.image('road', 'assets/images/road.png'); }, create: function() { this.game.world.setbounds(0, 0, 1136, 640); this.road = this.game.add.tilesprite(this.game.world.centerx, this.game.world.centery, this.game.width, this.game.height, 'road'); this.road.anchor.setto(0.5); }, update: function() { this.road.tileposition.y +=1; }
here example of tilling background have found in game http://www.nickjr.com/paw-patrol/games/paw-pups-save-the-day/.
can give me clue so? thanks!
i not sure tiling sprite correct way this, may better using standard sprite sheet animation.
i used method game here: http://www.nicktoons.co.uk/microsite/dribbletricks/3fo5mu
so sprite animation set loop. here, background symmetrical duplicated sprite , rhs of pitch scaled x value -1 sprite sheet/file sizes smaller allowing more frames.
Comments
Post a Comment