/// <summary> /// Simple Level lays out multiple levels of blocks /// </summary> /// <param name="width">Number of blocks wide</param> /// <param name="height">Number of blocks high</param> /// <param name="margin">space between blocks</param> protected void CreateBlockArrayByWidthAndHeight(int width, int height, int margin) { MonogameBlock b; //Create Block Array based on with and hieght for (int w = 0; w < width; w++) { for (int h = 0; h < height; h++) { b = new MonogameBlock(this.Game); b.Initialize(); b.Location = new Vector2(5 + (w * b.SpriteTexture.Width + (w * margin)), 50 + (h * b.SpriteTexture.Height + (h * margin))); Blocks.Add(b); } } }
public void Reflect(MonogameBlock block) { this.Direction.Y *= -1; //TODO check for side collision with block }