Learn › GBA Beginner

Lesson 2 of 6 · About 5 min

Layers and parallax

The far mountains move slower than the ground, and that is what makes the world look deep.

Spring Jump: far blue mountains behind the ground and the hero.

Why far mountains move slower than the ground, and how Spring Jump draws its scenery from a line of digits.

Near things move faster

When you look out of a moving train, the fence goes by quickly and the hills far away barely move. Games copy this with parallax: the background is split into layers, and each one scrolls at its own speed.

On the GBA each background layer has its own scroll position, so parallax costs almost nothing: the game sets a few numbers each frame.

Scenery from digits

Spring Jump draws its far mountains and middle hills from short lines of digits, FAR_PROF and MID_PROF, one line for each level. Each digit is one column, and says how many tiles tall the shape is there, from 0 to 9. The line is 32 columns and repeats as the level scrolls.

So 0013456787 is a slope going up, and 9999 is a flat top. Changing the digits changes the shape of the whole skyline.

Taller mountains

In the session you will give the first level taller, broader mountains in the far layer.

Spring Jump in the editor with taller far mountains behind the title, and the AI's reply in the chat.
Change the mountains

Try it yourself

In the app this lesson opens a real game for you, with a guide that walks you through these steps:

  1. The far mountains of each level come from one line of digits in FAR_PROF.
  2. Make the far mountains in the first level taller and broader.
  3. Watch the mountains as the demo runs: they move slower than the ground, which is what makes them look far away.
Start makingDownload on the App StoreGet it on Google Play