public override void Initialize() { base.Initialize(); this.spriteBatch = new SpriteBatch(GraphicsDevice); this.pixel = new Texture2D(this.GraphicsDevice, 1, 1); pixel.SetData <Color>(new Color[] { Color.White }); initialized = true; this.collisions = new CollisionMap(); int x = 0; int y = 0; foreach (TileBehavior b in TileBehavior.Values) { collisions.Add(new Rectangle(x, y, 16, 16)); if (x + 32 >= this.Width) { y += 16; x = 0; } else { x += 16; } } }
public override void Initialize() { base.Initialize(); this.spriteBatch = new SpriteBatch(GraphicsDevice); this.pixel = new Texture2D(this.GraphicsDevice, 1, 1); pixel.SetData<Color>(new Color[] {Color.White}); initialized = true; this.collisions = new CollisionMap(); int x = 0; int y = 0; foreach (TileBehavior b in TileBehavior.Values) { collisions.Add(new Rectangle(x, y, 16, 16)); if (x + 32 >= this.Width) { y += 16; x = 0; } else { x += 16; } } }