Friday, March 4, 2011

Starry night background

Here's what the background looks like. It scrolls from right to left:

If you want to use this yourself: Making a Scrolling Background on MSDN.

Code

You can download the CS-files from MSDN and the implementation of their background class is very short: BackgroundGameScreen.cs (CodePlex)

Notice how I now use a shared SpriteBatch. Because GameScreen inherits from DrawableGameComponent, it has a property allowing access to the Game-object.

Next, I'll start working on the GameplayScreen.

0 comments:

Post a Comment