Example #1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            bitmap = new Bitmap(ClientSize.Width, ClientSize.Height);
            gfx    = Graphics.FromImage(bitmap);

            Color color = Color.FromArgb(255, 3, 3, 3);

            // Color color = Color.FromArgb(255, 30, 30, 30);

            ball    = new BallClass(100, 100, 100, 100, 10, 10, color);
            paddle  = new PaddleClass(0, 150, 40, 180, color);
            paddle2 = new PaddleClass(1340, 150, 39, 180, color);
        }
Example #2
0
 public void IntersectsPaddle(PaddleClass paddle, bool leftPaddle)
 {
     if (Hitbox.IntersectsWith(paddle.Hitbox))
     {
         if (leftPaddle)
         {
             speedX = Math.Abs(speedX);
         }
         else
         {
             speedX = -Math.Abs(speedX);
         }
     }
 }