Sprite collision function I made
I made this function you can put into your project to detect sprite collisions. It returns true or false depending on if they are colliding or not. To use it, just make sure both of the sprites are their own objects and have x and y properties. Here is the function:
  checkCol = function(ob1, ob2, colRad)
    colliding = false
    if ob1.x < ob2.x + colRad then
      if ob1.x > ob2.x - colRad then
        if ob1.y < ob2.y + colRad then
          if ob1.y > ob2.y - colRad then
            colliding = true
          end
        end
      end
    end
    
    return colliding
   end
