How to implement line of sight restriction in actionscript? I have a problem with a game i am programming. I am making some sort of security game and i would like to have some visual line of sight. The problem is that i can't restrict my line of sight so my cops can't see through the walls. Below you find the design, in which they can look through windows, but not walls. Further below you find an illustration of what my problem is exactly. this is what it looks like now. As you can see, the cops can see through walls. This is the map i would want to use to restrict the line of sight. So the way i am programming the line of sight now is just by calculating some points and drawing the sight accordingly, as shown below. Note that i also check for a hittest using bitmapdata to check whether or not my player has been spotted by any of the cops. private function setSight(e Event null) Boolean g copCanvas.graphics g.clear() for each(var cop Cop in copCanvas.getChildren()) var angle Number cop.angle var radians Number ( angle Math.PI) 180 var radius Number 50 var x1 Number cop.x (cop.width 2) var y1 Number cop.y (cop.height 2) var baseX Number x1 (Math.cos( radians) radius) var baseY Number y1 (Math.sin( radians) radius) var x2 Number baseX (25 Math.sin( radians)) var y2 Number baseY (25 Math.cos( radians)) var x3 Number baseX (25 Math.sin( radians)) var y3 Number baseY (25 Math.cos( radians)) g.beginFill(0xff0000, 0.3) g.moveTo( x1, y1) g.lineTo( x2, y2) g.lineTo( x3, y3) g.endFill() var cops BitmapData new BitmapData(width, height, true, 0) cops.draw(copCanvas) var bmpd BitmapData new BitmapData(10, 10, true, 0) bmpd.draw(me) if( cops.hitTest(new Point(0, 0), 10, bmpd, new Point(me.x, me.y), 255)) gameover.alpha 1 setTimeout(function() void gameover.alpha 0 , 5000) stop() return true return false So now my question is Is there someone who knows how to restrict the view so that the cops can't look through the walls? Thanks a lot in advance. ps i have already looked at this tutorial by emanuele feronato, but i can't use the code to restric the visual line of sight.