Breakout collision with block laterally

I am creating a breakout game in c#. Everything is working fine excepting one feature
My blocks are destroyed after the second hit ,but if the ball hits the side (left or right) of the block , the block is destroyed instantly..

Example here

What's the feature needed to avoid this problem ? Thanks in advance ! Here is the code where the "action" is happening :

foreach(Control x in this.Controls)
{

if (x is PictureBox && x.Tag == "block")
{
if (ball1.Bounds.IntersectsWith(x.Bounds))
{
x.Tag = "Hit";
bally = -bally;
}
}
else
{
if (x is PictureBox && x.Tag == "Hit")
if (ball1.Bounds.IntersectsWith(x.Bounds))
{
bally = -bally;
this.Controls.Remove(x);
if(score<=5)
speed = speed + 1;
}
}
}


x - my blocks

Point pt = ball1.Location;
if (pt.X < 0 || pt.X > ClientRectangle.Width - ball1.Width)
ballx = -ballx;

• Maybe I'm missing something but I don't see where your code for bouncing the ball in the x direction is? I only see bally = -bally; where is the reflection for the ball's x movement on a side-block collision (presumably ballx = -ballx;)? – Jack Aidley Apr 7 '19 at 12:01
• I edited my post. That's my only reflection on a side collision. Should I add one more case ? What should the condition be ? – Alin00 Apr 7 '19 at 12:08
• That code appears only to account for edge collision with the frame of the window, not with collision with the side of any block? – Jack Aidley Apr 7 '19 at 12:18
• And how do I check the collision with a side of a block ? – Alin00 Apr 7 '19 at 12:29
• Given that you're not checking which side of the block you're colliding with, I think your question is now a duplicate of this one: gamedev.stackexchange.com/questions/22609/… (although that's in Java, it makes no material difference) – Jack Aidley Apr 7 '19 at 16:04