-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLevel.cs
More file actions
46 lines (40 loc) · 1.14 KB
/
Level.cs
File metadata and controls
46 lines (40 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using System;
using System.IO;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using System.Text;
namespace XNAtut
{
class Level : IDisposable
{
//Level structure
private Texture2D[] layers;
private const int EntityLayer = 1;
//Level Content
public ContentManager Content
{
get { return content; }
}
ContentManager content;
public void Dispose()
{
Content.Unload();
}
public Level(IServiceProvider serviceProvider, Stream fileStream, int levelIndex)
{
content = new ContentManager(serviceProvider, "Content");
layers = new Texture2D[1];
layers[0] = Content.Load<Texture2D>("Backgrounds/bglayer");
}
public void Draw(GameTime gameTime, SpriteBatch spriteBatch)
{
//Draw background layers
for (int i = 0; i < EntityLayer; i++)
{
spriteBatch.Draw(layers[i], Vector2.Zero, Color.White);
}
}
}
}