sombriks Posted May 27, 2015 Share Posted May 27, 2015 Hello all, currently i'm using a trick to make my game look endless: while i keep moving the camera and the player, i test if the end of the world is near; if yes, my camera will stop to slide soon. Then, i simply change the x coordinate value to 0. Doing the correct math and the correct scenario, the jump will look quite good. But it's not enough. For example, if some item where present in the last portion of the world, it certainly won't be at the begining. It leads to make sure that certain items will use the very same spritre, and so on. Is there any other way to get the endless effect? any effective way to create the illusion? Any idea is welcome. Link to comment Share on other sites More sharing options...
fariazz Posted May 27, 2015 Share Posted May 27, 2015 You can create a background that's moving and repeating itself forever using Tile Sprites and the autoScroll method:var background = this.add.tileSprite(0, 0, this.game.world.width, this.game.world.height, 'background');background.autoScroll(this.levelSpeed, 0); sombriks 1 Link to comment Share on other sites More sharing options...
sombriks Posted June 1, 2015 Author Share Posted June 1, 2015 You can create a background that's moving and repeating itself forever using Tile Sprites and the autoScroll method:var background = this.add.tileSprite(0, 0, this.game.world.width, this.game.world.height, 'background');background.autoScroll(this.levelSpeed, 0); Thanks a lot for the answer. Due to other reasons i ended up doing 3 groups for the scenario and playing with their x coordinates and shuffing sprites inside them everytime they come offscreen. I'll use autoScroll approach next project Link to comment Share on other sites More sharing options...
Recommended Posts