So for a class project, I'm making a solvable maze game (in Java). I can randomly generate and display the maze without a problem, and the same goes for the user/player's representation. However, the problem I'm having is with the individual walls of the maze.
I need to make sure that the player can't go through the walls. I've looked around, and it seems a lot of people have similar problems, but they are using a grid structure to make their mazes. I'm not --my maze's walls are just lines, so I can't do what everybody else is doing, (just see if a certain cell in the maze is already occupied --I don't have cells to check).
What I do have is both end points of the line --the starting x, starting y, ending x, and ending y-- and the current point of the upper left corner of the circle that represents the player. I also have the point of the proposed new upper left corner of the circle.
I need to know if the player is going to cross any of the lines that represent walls. At the moment, I loop through an array that contains all of the walls. Given the current player position and proposed player position, I need to find out if that involves crossing a wall. Any tips/hints/help would be much appreciated. Thank you in advance!