How to create Fog of War on Mini Map to display enemy based?


I have created a minimap with this tutorial

I would like to know how can I create a fog of war script for based on this, such that my enemy will not be shown within a certain area from my player?

Example if my player is at a certain point, and is set that the fog of war would only display a radius of 100 from my player. Then enemy that is within the 100 radius near my player will be displayed on the minimap, other wise it will not be displayed as a red dot on the minimap.

Thanks for helping.

If you just want an 'on/off' effect (rather than a gradual fade), you can perform a distance (or squared distance) check between the player and each entity, and only display an indicator on the radar for those entities that are within the specified distance from the player.