I want to make a PAC MAN imitation game to start working on AI, and while my first version will feature rectangles with widths or heights of 1 to makes walls for collision detection, I want to eventually make walls that are at 45 degree angles. I have found no guides out there to do this, only that rectangles can't be rotated apparently.
what your are asking for is analytic geometry. I think there are mainly two scenarios, assuming your wall is only a line:
- Your Player's bounding volume is a circle: Calculate distance from center of the circle to line, and check whether it is smaller then the radius. Check out this: Distance from point to line in 2D on Wolfram.
- Your Player's bounding volume is a rectangle: Your have to calculate each intersection of the rectangles four lines and check whether one of the intersection lies in between start and end point of one line. Check out this: Line-line intersection on Wikipedia