How do people code the mini-map radar's you see in games? (I'm thinking in the context of a PBBG/MMO built on a HTML5/JS/Node stack). Here is a visual example of the general idea I want to achieve:
This is the reply I got which I mentioned previously, but I was hoping for answer a little bit more detailed:
What are the best methods for coding a real-time radar which displays nearby players and objects in the game popping up on it as they come in range or what have you? I could probably hack together something hideous and terribly inefficient, but I was hoping to learn a smart/efficient way of achieving this type of feature.The feature you're referring to is generally called a minimap or radar, depending on the game, but to draw one the main trick to it is that you just need to divide all object positions by a big number (the bigger the number, the closer together things will bunch on radar), and draw a colored circle or whatnot at that position instead of the graphic. There's no need to actually track or detect positions since the computer knows the actual coordinate positions of all things at all times. Since this feature is outside the scope of my course here I can't provide much more detail or troubleshooting on it here, but hopefully that's enough to get started on. Good luck with getting the feature sorted out!