Archive

Posts Tagged ‘Scrolling’

2D Platform Games Part 3: Scrolling and Parallax Backgrounds

January 21, 2013 6 comments

IMPORTANT! All of the articles in this series require you to have either Visual Studio 2010 or the Visual C++ 2010 Redistributable Package (4.8MB) installed in order to be able to try the pre-compiled EXEs provided with the examples. The Redistributable Package can be freely bundled with your own applications.

This article builds upon the demo project created in 2D Platform Games Part 2: Collision Detection Tweaks. Start with 2D Platform Games Part 1: Collision Detection for Dummies if you just stumbled upon this page at random!

Download source code and compiled EXE for the code in this article.

While it is perfectly acceptable to have a platform game with each level or section based on a single screen, some games require a larger world, and to display this we need to allow the world to scroll (from side to side, up and down or both) on-screen. In this article we will learn how to add scrolling to our project, as well as so-called parallax backgrounds which are background images which also scroll, but slower than the foreground level, giving a “2.5D” impression of depth. Read more…

%d bloggers like this: