sinanqd10 Posted September 2, 2016 Share Posted September 2, 2016 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, 'tileRoad'); this.road.anchor.setTo(0.5); }, update: function() { this.road.tilePosition.y +=1; } this code is for tilling the background from top to bottom. However, I would like to tilling the background straight to the camera view. what technique I need to use for achieving it? here is the example of the tilling background I have found in this game http://www.nickjr.com/paw-patrol/games/paw-pups-save-the-day/. Can anyone give me a clue to do so? Thanks! Link to comment Share on other sites More sharing options...
symof Posted September 3, 2016 Share Posted September 3, 2016 I can't access that game link you gave, i'm getting a redirect to a different tld. But this should be what you are looking for. http://codeincomplete.com/posts/javascript-racer-v3-hills/ http://codeincomplete.com/games/racer/v4-final/ http://codeincomplete.com/posts/javascript-racer/ https://github.com/jakesgordon/javascript-racer/ Link to comment Share on other sites More sharing options...
sinanqd10 Posted September 5, 2016 Author Share Posted September 5, 2016 @symof I have found these articles, but I really don't understand the flow @@. Could you please simplify? Link to comment Share on other sites More sharing options...
symof Posted September 5, 2016 Share Posted September 5, 2016 6 minutes ago, sinanqd10 said: @symof I have found these articles, but I really don't understand the flow @@. Could you please simplify? I actually can't. That article explains it much better and more detailed then I could. It should be a sufficient starting point for you to know what you need. If you're expecting a cheese way of doing it, i'm sorry to say you won't find it, as programming complex code still requires math. http://www.extentofthejam.com/pseudo/ Link to comment Share on other sites More sharing options...
sinanqd10 Posted September 5, 2016 Author Share Posted September 5, 2016 @symof How can I get the distance camera in Phaser bro? Anyway, thanks you bro for helping. Link to comment Share on other sites More sharing options...
Recommended Posts