Exemple #1
0
 public void Deflection(Bricks brick)
 {
     if (!collided)
     {
         motion.Y *= -1;
         collided = true;
     }
     motion.Y *= -1;
 }
Exemple #2
0
        private void StartGame()
        {
            ball.SetInStartPosition(paddle.GetBounds());

            bricks = new Bricks[bricksWide, bricksHigh];

            for (int y = 0; y < bricksHigh; y++)
            {
                Color tint = Color.White;

                for (int x = 0; x < bricksWide; x++)
                {
                    bricks[x, y] = new Bricks(
                        brickImage,
                        new Rectangle(
                            x * brickImage.Width,
                            y * brickImage.Height,
                            brickImage.Width,
                            brickImage.Height),
                        tint);
                }

            }
        }