Create radar screen!

Hey guys,

I want to create a radar screen but don't know how to achieve this.

It looks like radars in online games.

Anybody can help me, thanks a bunch!  :smiley:

Do you mean like submarine radars - all green with dots to show other vessels, and a big green revolving needle that updates on each rotation

For graphics, I’m not yet your man. However, I could help you with a bit of the logic surrounding this.

You could keep an ArrayList of all pingable objects around your player. This ArrayList would need to be updated in your update method. Then you create a circle, and obviously the player has it’s origin at (0,0). Doing some Vector Math you should be able to add dots at the appropriate places to represent the local translation of things around you.

For instance, if you’re keeping track of anything that is 500 units away from you (on the X-Z plane, meaning height doesn’t matter) you could figure out which enemies are near you via the distance formula and add anything with <= 500 distance to the ArrayList.

While rendering, render a dot inside the circle for each enemy. There is probably a way to put points within the circle from it’s origin. If this is the case, simply use vector math to find an enemy’s local translation as if your translation was 0,0.

SO your ArrayList would contain data like these: Enemy at 1204.50, 1203.3 and Enemy at 900.5, 1300.5.

Your local translation is 1000,1000. You then use vector math to determine their local translations as being (204.5, 203.3) and (-99.5, 300.5) and create dots at those points.

Hopefully that all makes sense–I’ll re-read it when I’m actually awake (it’s quite early here, I just can’t sleep) to make sure. If you have more questions, PM me.

I would like to make a radar like in Counter-Strike, WorldCraft…

And now, after reading a post from Trussell, I really don't know where from start.

Maybe, I need some more help!  :slight_smile: