Parallax scrolling

Top  Previous  Next

This month we get to play with a full 2D game that uses parallax scrolling.

 

aum71_parallax

 

Parallax scrolling is a pseudo-3D technique where the background images move together with the camera, slower than the foreground images, creating the illusion of depth and making the game look more realistic. My game consists of 4 layers:

 

1) The background.

 

aum71_parallax2

 

2) The mountains.

 

aum71_parallax3

 

3) The vegetation.

aum71_parallax4

 

4) The foreground.

aum71_parallax5

 

All of these are in fact different panels that move at different speeds and have different layers. I have decided to add a player and an enemy as well; the enemy will fire bombs and the player will have to avoid them in order to get a big score. Whenever the player is hit, its score is decreased.

 

The code is fully commented, so you can start creating your own 2D game the right way and right away.