Jump to content

sprite wrap around world


caesar
 Share

Recommended Posts

hey i was wondering if a sprite could wrap around the world so i used this.

game.world.wrap(circlebar, 0, true);

and it works fine. but the problem with this is that the sprite leave the screen and then comes back around. is there a way the sprite could wrap almost like a snake following itself? where the beginning would start from the right side of the screen and the ending would still be moving to the left. 

thanks in advance.

Link to comment
Share on other sites

No, because for a brief moment the sprite would have to be two sprites; one leaving the screen and one entering. With a bit of lateral thinking, using this knowledge of the necessity for multiple sprites (possibly as many as four, if the sprite moves over a corner of the screen for instance) you could probably create a clever way of synchronising the relative positions of duplicate sprites when a sprite begins to leave the screen.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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