I am SOOOO close to getting the collision detection working. I don't think I'll need to cast any kind of ray as that's overcomplicating the problem.
My big issue seemed to be the way I was telling the computer to check the positions of the ball against the brick. I was using
ball.x or
ball.y to check, and what I SHOULD have been doing was getting the width+height of the ball with
GetSpriteX() and
GetSpriteY() and same for the bricks, and wah-la, suddenly the bricks started deleting correctly, one at a time, as they should be!
But the main problem I'm still having is getting the directions to reverse correctly, so I'm looking into using Vectors, which AppGameKit doesn't seem to have much documentation on...
I modified my code as such (yes, there are still some magic numbers but it's easier to see them that way the moment, once I figure out the right values they'll become a #constant):
Rem Bounce the ball back
If GetSpriteX(ball.ID)/2 - 8 < GetSpriteX(bricks[x].ID)/2 or GetSpriteX(ball.ID)/2 + 8 > GetSpriteX(bricks[x].ID)/2
ball.sx = -ball.sx - speed_increase
ElseIf GetSpriteY(ball.ID)/2 + 8 > GetSpriteY(bricks[x].ID)/2 or GetSpriteY(ball.ID)/2 - 8 < GetSpriteY(bricks[x].ID)/2
ball.sy = -ball.sy - speed_increase
EndIf
The code for bouncing the ball back in the x direction works fine, but the y direction code seems to never get executed for some reason.
BUT I AM SO CLOSE I CAN TASTE IT

It's back, baby!