A Haxe implementation of the line of sight algorithm on [roguebasin]()

Usage:

var map_data = [
	' ########       '.split(''),
	' #......#       '.split(''),
	' #......#       '.split(''),
	' #......####### '.split(''),
	' ####.####....# '.split(''),
	'   #..........# '.split(''),
	'   #...###....# '.split(''),
	'   ##### ###### '.split(''),
];
var los = new LineOfSight({ map: map_data, walls: ['#'] });
var p = { x: 5, y: 5 };

los.fov(p.x, p.y, 6);
for (row in los.place_char(los.get_lit_map('?'), '@', p)) trace(row.join(''));

Output:

???#####????????
????...?????????
????...?????????
????...?????????
??###.####.?????
   #.@.....?????
?? #...###.?????
???#####????????

Constructor

new (options:{walls:Array<T>, map:Array<Array<T>>})

Methods

fov (x:Int, y:Int, radius:Int):Void

get_lit_map (unseen:T):Array<Array<T>>

place_char (map:Array<Array<T>>, char:T, p:{y:Int, x:Int}):Array<Array<T>>