- Home /
2D Infinite Vertical Background scrolling
Hello,
Im creating a game similar to Ninjump or Doodle Jump and its just gonna be one illustrated background (portrait mode). Please can anyone one help me with the code for the infinite vertical background scrolling that incorporates with the camera at the Y axis? Im coding in c#. I searched online and found nothing useful.
Thanks in advance
Answer by hexagonius · Feb 12, 2015 at 11:34 AM
Two approaches here:
Have the background attached to the camera and set it to repeat mode. Then adjust its offset on the material while you move. Divide y-distance from the starting position of the camera by your vertical units (Camera orthosize * 2) and modulor 1
Create two background images. Whenever OnBecameInvisible() is called, move it up by its height
Thanks for the tips but I'm alittle confused. How do I make what you said to a code? Please could you give me a headstart? Thanks