Using scroll rates to create depth perception

● ARCHIVED · READ-ONLY
Started by Tsukihime 2 posts View original ↗
  1. This tutorial goes over how you can use different map layers to create depth perception when the player is traveling across your map.


    It uses "scroll rates", which determines how fast a map scrolls per step taken.


    By default, the map scrolls 32 pixels per tile, or basically one tile. However, you can specify higher or lower scroll rates on overlay maps to create various visual effects:


    overlaymapsani1.gif


    Required


    Script: Overlay Maps


    Tutorial


    Our final map will be composed of two layers: the sky island that we will stand on, and the sky city below.


    I took out most of the floors to make it easier to see what is happening.


    The first step is to simply prepare your two maps. It is just regular mapping


    Sky Island


    overlayMapsEx1.jpg


    Sky City


    overlayMapsEx2.jpg


    The second step is to combine them using overlay mapping.


    1. We will be standing on sky island, so we will use the sky city as an overlay map. Sky city is map 4.


    2. We want to place it one layer under our current map, so we set the layer order to -1.


    3. Offsetting is not important, so we leave it at (0, 0). This will just draw the sky city beginning at the upper-left corner of the map.


    4. We want the sky city to scroll slower, so we give it a scroll rate of 8.


    overlayMapsEx3.jpg


    And that's it! Just load up the game and you should be able to see nice things when you're walking on sky island.
  2. So at this point you're my favorite person on this forum. :p

    Keep up the fantastic work, and fantastic tutorial.