Game Development Reference
In-Depth Information
Figure 2.7 Space scene broken into three layers to facilitate parallax scrolling.
The single direction scrolling pseudocode could be updated to instead have mul-
tiple background sprite lists, one for each layer. To implement the parallax effect,
when it's time to calculate the offset of the sprite based on the camera, an addi-
tional factor must be applied. If a particular background layer is intended to move
at a fifth of the speed of the closest layer, the offset calculation code would be as
follows:
Search WWH ::




Custom Search