Day 4: Parallax Background

Development time: 2 hours

I thought some more about the parallax background concept and decided to have three layers: layer 1 would be more larger and more diffuse stars in the distance moving at a slow speed; layer 2 would be medium sized stars slightly more in focus moving at a medium speed, and layer 3 would be random stars moving at random speeds.  The combination of the three layers should be enough for an interesting effect.

I created the first two layers in Adobe Fireworks, and then added code for all three layers to scenes/menu.lua.  I coded up all three layers and tested it out.  Playing around with the numbers led to settling on 40 random stars for the third layer.  Once I was happy with the look, I moved all of the code into a separate file libraries/starfield.lua so that it could easily be re-used from within other scenes that needed the background.

Next: Day 5

Get Asteroid Blasteroid

Download NowName your own price

Leave a comment

Log in with to leave a comment.