Game Development Community

Making radar?

by Spencer Grey · in Torque Game Builder · 06/20/2006 (10:58 am) · 1 replies

Hey guys,

The game I'm working on right now has a few different view modes. One of them is radar. What I'm picturing is everything in the radar screen is black, but when the expanding circle pings out, and touches an object, the object is made visible. Then, the object slowly fades away, until the next ping hits it.

Now I have a couple of ideas in my head about how to do this, but I'm not sure which one will work the best.

The first is to have everythings alpha set to 0. Whenever the circle (the ping graphic) hits an object, the object has its alpha reset to 100, then is added to a list of objects. The list of objects would be run through a loop every update, and each object would have its alpha decreased by a certain amount. Once the object's alpha is back to 0, then its removed from the list.

One of the issues I have with this is that I need the walls to alpha out also. However, if I understand this right, then the entire layer that contains my walls is a single object (?). If thats true, then I wouldnt be able to have each piece of wall change its alpha seperately.

--

Another idea is to use a gradient mask. Have a black mask over the entire map, and use the circle to create transparency. So the mask would have 100% transparency wherever the circle is (not inside of the circle, just the outer ring), and would have a gradient inside the circle, depending on the distance. So if the circle just pinged, it would be on the players radar blip, which would cause the blip to be seen in full. When the ping is at its max distance, the players blip (in the direct center of the ping) would be just about invisible.

I haven't really thought out *how* I would do this yet, and I'm sure theres a ton of issues with that, since I'm coming up with this off the top of my head, but thats another idea I'm tossing around. If I went with something like this, then the walls wouldnt be an issue. Ofcourse, its probably 200 times harder to do then the first method (since interacting with objects is fairly easy).

--

If anyone has any better ideas, or any input that would help me figure out how to go about this, then I'd love to hear it. If I use a mask, how should I make the mask? Can I use a single image and do gradient stuff like in flash? Would I use small tiles to make a black mask, like fog of war? Etc, etc, etc.

Also, if anyone has a good way for making a circle have its circumfrence change size, but the thickness remain the same, I'd love to hear it. Doing that with a rectangle is easy, I haven't tried doing that with a circle yet.

--

Anyway, thanks for all the input. Sorry for a long winded post!

#1
06/20/2006 (11:17 am)
Wow. Just downloaded the newest update. It has a level that does exactly what I want! Now to figure out how its doing it :)