I’m pretty impressed and excited about today’s completed feature. It’s one of this things that makes me think: oh man, coding is so much fun! Remember on day 11 when I worked on the FOV method and talked about how I wanted this to be divided in three, later reusable, steps? Well, with the LOS algorithm (third step) we can check also if a unit sees another unit from the opposite team.
First I created a method which returns all opposite teams from the current team. The original game and original scenarios worked always with two teams. But I left the possibility, that maybe in the future, more than two teams can play a scenario in a death match or in cooperation mode. Then I loop through all opposite teams and units and check if current unit sees one of them. Of course these units are shown then on the map.
