Camera

Contents
1. How the Camera restricts Mario
2. Views
3. Panning blocks
4. Scroll Control and Scroll Stop sprites
5. Header Blocks

The Camera in New Super Mario Bros is controlled in several ways. You have to take into account that the camera movements will condition the gameplay.

1. How the Camera restricts Mario


The camera restricts Mario's movements in two ways:

• Mario cannot go out of the camera view through the sides.
This means that if the camera doesn't pan further, Mario can't either. The camera sides act like walls (but you can't wall jump into them)
• Mario cannot go to the bottom of the camera.
If he does so, he will die. Note that there is some margin, so you can place something like a Warp to Level some blocks below the camera view. Mario will get it before he dies.

Mario does can go out from the top of the camera. Simply the camera will not pan there, so Mario will be out of the screen.

2. Views


The camera will NEVER get out of the view. That means Mario can't get out of the view by the sides or the bottom.

3. Panning blocks


This thing is a little bit confusing. An area (not each view) is divided in blocks of 16x16 tiles (256x256 pixels). The camera will not pan into blocks that are empty (don't contain any objects).

An example (thanks to Garmichael):
Look at this level:



Posted by Garmichael
Notice that blocks A and F are empty. Mario cannot get to A from B, but he can actually jump from D to B. While he is in A, the camera will not move, but as soon as he crosses into B, the camera will jump to that location and that boundary would act like a wall. From there, As Mario approaches C, he will be able to see some of F, but as soon as he crosses into C, the camera will reposition so that the border to F is the bottom of the screen. If Mario jumps down into F, he dies (even though the block under F has ground).


4. Scroll Control and Scroll Stop sprites


These sprites control the camera in more ways. How they work is generally unknown, except for:
• Vertical scroll controls: [sprites:198] and [sprites:199]
• Horizontal scroll stop: [sprites:276]

5. Header Blocks


Block 2, Block 4, and Block 5 control more settings of the camera. Look at the List of Header Blocks page for more info.