The method I showed works best with top-down games. there is a more flexible method for collision. Basically imagine that the ball is enclosed in an imaginary box. You need to know the midpoint of the box/circle and the distance from the mid-point to the sides of the box. Using this, check where what tiles the corners of the box will be in if the ball continues to move. If any of the corners are not in tile 0, then a collision has occurred.

Here's a function that you may find useful. Just pass in where the ball will be, and its radius.

That's because you aren't checking for a diagonal collision. Try this code, it isn't efficient but you should be able to simplify it. Also remember that the maximum size of the radius should be 10. If it's bigger you'll need to break the circle down to smaller squares.