Parallax scrolling: Difference between revisions

Content deleted Content added
No edit summary
Oklonia (talk | contribs)
Cleanup
Line 1:
{{cleanup}}
 
 
'''Parallax scrolling''' is a special [[scrolling]] technique in [[computer graphics]]. It gives a 2D [[video game]] a greater sense of depth and immersion by creating the illusion of a third dimension.
There are three main methods of [[parallax]] scrolling onused in titles for [[video game console]] systems. FirstThe first game to feature parallax scrolling was an arcade game called [[Moon Patrol]]. (1982)
 
=== The layer way ===
If yourthe display system supports multiple background layers, youit can scroll them by simply changing each layer's horizontal offset by a different amount. However, placing too much in front of the layer containing the objects with which the player interacts obscures the action of the game and may be distractive to some users.
However, you don't want to place too much in front of the layer containing the objects with which the player interacts;
otherwise, you'll obscure the action, which is annoying, and annoying games don't sell.
 
=== The raster way ===
To parallax- scroll within one layer (necessary on classic 8-bit systems such as [[Nintendo Entertainment System]] and the original [[Game Boy]]), the systems generally divide the layer into sub-layers and change the layer's horizontal scroll value just before the display system begins to draw each scanline. This is called a "[[raster effect]]" and is also useful for changing the system [[palette]] to provide a gradient background.
 
This is called a "[[raster effect]]" and is also useful for changing the system [[palette]] to provide a gradient background.
Some platforms ([[Super Nintendo Entertainment System|Super NES]], [[Sega Genesis]], [[Game Boy Advance]], [[Game Boy]]) provide horizontal-blank interrupts for automatically setting the registers; others, such as the NES require the use of cycle-timed code. Many NES games such as the classic ''[[Super Mario Bros.]]'' use this technique to draw their status bars, and ''[[Teenage Mutant Ninja Turtles II: The Arcade Game]]'' and ''[[Vice Project Doom]]'' for NES use it to scroll background layers at different rates.
Many NES games such as the classic ''[[Super Mario Bros.]]'' use this technique to draw their status bars, and ''[[Teenage Mutant Ninja Turtles II: The Arcade Game]]'' and ''[[Vice Project Doom]]'' for NES use it to scroll background layers at different rates.
 
More advanced raster techniques can produce interesting effects. YouA system can achieve breathtaking depth of field if you combine layers with rasters are combined; ''[[Sonic the Hedgehog 2 (Megadrive)|Sonic the Hedgehog 2]]'', ''[[ActRaiser]]'', and ''[[Street Fighter II]]'' used this effect well. If you make each scanline itshas it's own sub-layer, you get the ''[[Pole Position]]'' effect is produced, which creates a pseudo-3D road (or in ''[[NBA Jam]]''<nowiki>'</nowiki>s case, a pseudo-3D ball court) on a 2D system.
If yourthe display system supports rotation and scaling in addition to scrolling, changing the rotation and scaling factors can draw a projection of a plane (''[[F-Zero]]'', ''[[Super Mario Kart]]'') or can warp the image to create an extra challenge factor (''[[Tetanus On Drugs]]'').
 
=== The sprite way ===
If youthere haveis amuch lotin the way of the [[sprite (computer graphics)|sprite]]s (individually controllable moving objects drawn by hardware on top of or behind the layers) available on yourthe display system, youthe mayprogrammermay want to make a pseudo-layer out of sprites. ''[[Star Force]]'', an overhead-view vertically-scrolling shooter for NES, used this for its starfield, and ''[[Final Fight]]'' for Super NES used this technique for the layer immediately in front of the main playfield.
''[[Star Force]]'', an overhead-view vertically-scrolling shooter for NES, used this for its starfield, and ''[[Final Fight]]'' for Super NES used this technique for the layer immediately in front of the main playfield.
But watch out for sprite flicker; you'll want to heed these tips for [http://everything2.com/index.pl?node=preventing%20sprite%20flicker%20on%20old%20consoles preventing sprite flicker on old consoles].