This is a DEMO, not a GAME -
EDIT This version has a small bug - see my next post down - END EDIT
This demo shows how you can set up all the bad guys, to check whether they can see you ( or if you can see them..) - it works with as many enemies as you want (within limits) and works much better then the canvas draw method I showed in another demo.
if they are "red" they can see you... if they are "black" they can't...
It is based on something DST said to me.. so many thanks DST. i hope this is what you meant.
you can set it up so that the "line of sight" gets blocked only by walls, or by walls and objects, and/or walls and objects and other characters etc etc
The enemy movements are completely random - and the player movements are a bit off ( too lazy to code it all..)
use cursor keys to move, press space bar to see how it works (in the "how it works" demo everything will slow down because of the number of actors being drawn) so, press space bar to remove the "how it works - demo"
it can be improved somewhat and if/when i do i will post a cleaner faster version, until then ...