-
Notifications
You must be signed in to change notification settings - Fork 1
/
Grid.cs
40 lines (37 loc) · 1.02 KB
/
Grid.cs
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
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
namespace Dazzer
{
class Grid
{
int[,] gridMap;
Texture2D texture;
int width = 100;
int height = 100;
public Grid(ContentManager content)
{
gridMap = new int[width, height];
texture = content.Load<Texture2D>("Rock");
}
public void Draw(SpriteBatch spriteBatch)
{
spriteBatch.Begin();
for (int x = 3; x < width - 3; x++)
{
for (int y = 0; y < height; y++)
{
spriteBatch.Draw(texture, new Rectangle(x * 35, y * 35, 30, 30), Color.White);
}
}
spriteBatch.End();
}
}
}