I am working on a game that is similar to a game of geometry wars, except it features only 1 enemy with ALOT of artificial intelligience.
I'm trying to create a Line Of Sight for my AI so that with my Finite State Machine, I can transition from a hunt mode to an Attack Mode (which I have already coded briefly).
Its a simple game thus far, and a top down view game, so the AI already knows where the player is, but I want to create a simple LOS so he knows when to start shooting (i.e. he will not shoot if there is a wall in his way)
I was thinking of drawing a line between the Enemy and the Player that will loop and constantly update, and create a function to determine if the Line is colliding with any other objects, if it is then the AI will not shoot.
I know how to draw a line with the LINE command, but I cannot figure out what to do next and would highly appreciate anyone's help!

I am actively working on this so I will post again if I have come up with the solution and what the solution is.
Also if you know a simpler, and or better way to calculate an AI's LOS then please tell me. Thank You!
Beginning Programmer
Professional Nerd