예제 #1
0
파일: Brick.cs 프로젝트: mmartinx/Arkanoid
        public static IEnumerable <Brick> GenerateBricks(int width, int height, int rows, int cols, Color color, SpriteBatch spriteBatch)
        {
            Texture2D texture = TextureBuilder.BuildTexture(width, height, color, spriteBatch);

            for (var y = 0; y < cols; ++y)
            {
                for (var x = 0; x < rows; ++x)
                {
                    yield return(new Brick(width, height, new Vector2(x * width, y * height), spriteBatch, texture));
                }
            }
        }
예제 #2
0
파일: Paddle.cs 프로젝트: mmartinx/Arkanoid
 public Paddle(int width, int height, Vector2 position, SpriteBatch spriteBatch) : base(width, height, position)
 {
     this.spriteBatch = spriteBatch;
     paddle           = TextureBuilder.BuildTexture(width, height, Color.Chocolate, spriteBatch);
 }
예제 #3
0
파일: Brick.cs 프로젝트: mmartinx/Arkanoid
 public Brick(int width, int height, Vector2 position, SpriteBatch spriteBatch) : base(width, height, position)
 {
     this.spriteBatch = spriteBatch;
     brick            = TextureBuilder.BuildTexture(width, height, color, spriteBatch);
 }
예제 #4
0
 public Ball(int width, int height, Vector2 position, SpriteBatch spriteBatch) : base(width, height, position)
 {
     this.spriteBatch = spriteBatch;
     ball             = TextureBuilder.BuildTexture(width, height, Color.White, spriteBatch);
 }