I have started to make a procedural Roguelike and am struggling to work out player movement.
So far the movement is tile based and works on a turn based system, where once the player moves, a global Boolean is set to false. if the boolean is false then the enemies can move.
if the enemies do not have LOS to player than the movement direction is random (this works fine).
if the enemies do have LOS to player then the enemy will move in the direction of the player.
I made an instance boolean variable to toggle if an enemy has LOS to player, to check in debug layout, if the LOS is working and it isnt.
here are some relevant pictures of the programming.