AdamP wrote:
Parallax scrolling: I know it can be done in case of none overlapping background elements. And it involves IRQs. But I saw scrolling where there was overlapping.
Developers always find clever ways to make it seem like the system is doing something it can't actually do. On the NES, there are several ways to simulate multiple background frames. When there's no overlap, creating a parallax effect is just a matter of changing the horizontal scroll mid-screen, which results in sections of the screen scrolling at different speeds. IRQs are very helpful in timing these splits, but they're doable without IRQs to some extent.
In cases where there are overlaps, one common technique is to complete the frontmost layers with sprites, like in
this part of Bucky O'Hare. There are 5 independent scrolling sections here (6 if you count the status bar!): 1 for the stars, 2 for the frog ships, then the background mountains, and the last one for the platforms. The frog ships appear to overlap because the rudders are made with sprites.
Another effect from Bucky O'Hare that I love is
this. They make it look like there are 2 completely independent layers over a stationary background, something that's nowhere near possible on the NES! Here's the trick: everything is in the same background layer, but the far background is very repetitive, and by changing the pattern when the background scrolls you can make it seem stationary (e.g. by scrolling the background right 4 pixels and swapping the pattern for one that's rotated 4 pixels to the left you cancel out the movement), and the frontmost layer repeats horizontally, so you can make it seem like it's moving sideways by drawing and erasing only the edges, where the spikes are, and cover the seam using sprites, which in this case are spikes.
Another game with impressive overlapping parallax effects is
Sword Master. The effect uses mid-screen scroll changes together with pattern changes. If the screen scrolls 2 pixels, this means that both the background and the foreground will scroll that much, but to make it look like the background scrolled less than that, the patterns are switched with a version that's rotated 1 pixel in the opposite direction.
Open these games in FCEUX or another emulator that lets you see the patterns in real-time and you'll understand these effects better.
Quote:
Foreground elements: This is what I have no idea at all. I played G.I. Joe and it has many foreground elements. How it works and what are the limitations? What I can do and what I can't?
These effects are possible because sprites have a priority bit, that places them either behind or in front of the background. When they're behind the background, the sprite will only show over parts of the background that use color 0, which is considered transparent.
Quote:
Weird distortion effect
Change the horizontal scroll every couple of scanlines and you can create wavy distortions.