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.
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 neither. 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.
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.
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:
(Quoted from 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).
You can download this level to test it yourself here
Scroll Control and Scroll Stop sprites
These sprites control the camera in more ways. How they work is generally unknown, except for: