This page is a mirror of Tepples' nesdev forum mirror (URL TBD).
Last updated on Oct-18-2019 Download

Metroid Scrolling

Metroid Scrolling
by on (#63351)
Hello everyone :)

I've been doing more research on how to implement scrolling on my NES-like XNA project, and this has led me to the game Metroid.

http://metroid-database.com/m1/lvldata.php

In theory - I have yet to program them but have the data marked up and documented - my maps would run just like in Metroid. Independent of each other but the game would scroll from one map to the next.

I have conceptualized and jotted down how collision detection would work. I'm just stumped how the developers programmed scrolling with the PPU. E.g., if there isn't a level to the left, stop scrolling left. Or move the camera right when the character is in the middle of the screen.

Stuff like that - in addition, remembering which column to draw onto the PPU nametables when the character moves left and right.

Any enlightenment?

by on (#63352)
IMO, the best way to handle scrolling is to create a camera object, and let it be responsible for all the background movement and rendering. You can easily customize everything you need about the scrolling by programming the behavior of this camera.

The simplest possible camera will follow the player and try to keep him at the center of the screen. For this the camera must keep track of the position of the character within the level and update it's own coordinates accordingly. If the camera tries to scroll into an are where it's not allowed to, it should stop and let the player be away from the center.

A camera object also serves as a reference for drawing sprites. Since the camera - like any other object - has a position within the level, you can use the relative position of other objects to it to find the absolute screen position where they must be displayed.

by on (#63537)
stumbled upon this over at romhacking.net, dunno if it would help you any but might be worth a look



http://www.romhacking.net/docs/459/