press space to change the position of the other point to your mouse. mess around with it.
the intersection between two lines. here's what's going on here. the first check is a box check. it checks if the collision is even worth going through by seeing if the player is in range. the second check is two dot products. this check is to see if the player went from one side of the object to the other. i will explain the actual math to anyone interested. the third check is based on the point of intersection. the point of intersection is found, and a box check is used to see if it is within the bounds of the object itself. this accounts for every scenario of a point passing through a line and can be used for player collisions. it will be the new basis for my sonic engine as the last one had issues i want to iron out.