Hello Guest

Author Topic: Sprite screen wrapping?  (Read 3096 times)

MrDys

  • Newbie
  • *
  • Posts: 1
    • View Profile
Sprite screen wrapping?
« on: June 01, 2013, 08:59:27 am »
Maybe I'm over thinking this one, but I'm having trouble coming up with a solution to this behavior:

Let's say I have a sprite that can be dragged horizontally. When I drag it off of the right hand side, I want it to wrap around and come out of the left hand side. This goes beyond just resetting the position, tough. If the sprite is halfway off of the screen, I would like the other half to be visible on the other side.

Any ideas?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Sprite screen wrapping?
« Reply #1 on: June 01, 2013, 10:25:58 am »
Create 2-3 sprites, place them horizontally.
Treat them as a conveyor belt and as one goes out of the screen on the left, just move it to the far right. Do the same for the right and you've got yourself an infinitely looping sprite.