Maxime Posted May 24, 2015 Share Posted May 24, 2015 Hi there, I'm using the method autoScroll on my sprite to make it the ground of my game, see https://github.com/maxailloud/Flappy-Plane/blob/using_p2/js/classes/Ground.js#L6. This work great for the displayed sprite but not for its body.Its body is not moving and so the body doesn't match the displayed sprite, as this one is scrolling.Look here http://maxailloud.github.io/Flappy-Plane/ the result, I display the body of each sprite to see the problem. Is there a way, I mean something already existing, to make the same behavior I got on the sprite but on the body on the sprite? I might guess that there is no solution other to do it myself but I ask anyway, just in case. Link to comment Share on other sites More sharing options...
rich Posted May 24, 2015 Share Posted May 24, 2015 autoScroll doesn't move the TileSprite anywhere, all it does is make the texture scroll. If it has a body it should not move position at all just because autoScroll is enabled. Link to comment Share on other sites More sharing options...
Maxime Posted May 25, 2015 Author Share Posted May 25, 2015 Ok I get it.Thank you. So if I want the body to move along the texture I have to make the sprite moving.Like an usual ground I'll have to make sprite move to the left border of the screen and then set its position to the right border of the screen again and again. Link to comment Share on other sites More sharing options...
Recommended Posts