Grr, ok so i had a better explanation 30 seconds ago but turns out I wasnt logged in and it vanished when I hit post.
Bubba is right, you can't draw a line and then try to figure out where that line was drawn. The line data that you have to work with is only the ends of the lines, you need info on the middle of lines too (the walls). This info is in the graphics card! This is most likely why your horizontal lines aren't being detected - they dont actually exist unless you have a drawline function in your checker. I think you MAY be able to access the graphics card data (maybe?) but it's complicated and i forget how to do it. If you want go to cprogramming.com and on the side bar theres a link that says "advanced graphics programming" and you might find it somewhere in there. But I doubt even that will help you.
I know you dont want to, but I really think what you need to do is create your walls somewhere where YOU can access them. This means making a 2D array/text file which is a 'map' of the maze, like the 0's and 1's that Bubba showed you. To do this youll need a drawline function of some sorts since you are starting with points and connecting them together - google, or theres one in the advanced graphics tutorials at cprogramming.com. Then you need to 'draw' your walls into a 2D array of the map - im assuming your not moving in 3D? Just put 1 if theres a wall, and 0 if not. or the opposite. whatever.
Now you have something to check your location against, since you can't check it against the line vertices (well you can but that doesnt tell you if theres a wall there. only the corners!). As your guy moves around, you are going to draw what he's seeing, and also check his position against the map. If theres a wall at his position (it's a big position, a circle, youll have to check all his boundaries) then reset his position to start. The map will be fairly high res, the same resolution as what his movements could be. You may or may not want to allow him to move more than 1 pixel - up to you.
Basics:
Code:
drawmazetoscreen();
map = createmap();
loop {
movedude();
if (map[dudex][dudey] == 1)
{dudex = dudestart;
dudey = dudestart;}
}
I hope this made some kind of sense. Good luck.
Mith~