Jump to content

Using autoScroll method on sprite doesn't affect P2JS body


Maxime
 Share

Recommended Posts

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

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

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...