Hello (again).
For my platformer game I'm making, (using the Platformer Starter Kit), I am trying to make it so each level has a different background.
I am a complete newb and have only started using Xna recently.
Is this the code I need to change?
public
Level(IServiceProvider serviceProvider, string path)
{
// Create a new content manager to load content used just by this level.
content =
new ContentManager(serviceProvider, "Content");
timeRemaining =
TimeSpan.FromMinutes(1.5);
LoadTiles(path);
// Load background layer textures. For now, all levels must
// use the same backgrounds and only use the left-most part of them.
layers =
new Texture2D[3];
for (int i = 0; i < layers.Length; ++i)
{
// Choose a random segment if each background layer for level variety.
int segmentIndex = random.Next(1);
layers[i] = Content.Load<
Texture2D>("Backgrounds/Layer" + i + "_" + segmentIndex);
}
}
Any help will be gratefully accepted.