//bx, by are the coordinates for a ball //powerX, powerY are the coordinates for another ball like shape (maybe a power up?) //Both are the same size of 20 by 20 squares. //NOTE: this only really works if the shapes you are colliding are sort of circle shaped, so squares or circles etc, but definitely NOT rectangles like for paddles etc if( dist(bx + 10, by + 10, powerX + 10, powerY + 10) < 20){ padY2 = width + 50; }