#define RADAR_RANGE 7
#define DEBUG
obj
var
team
client
var
obj/radar // The client's radar object (handy because we get reference to it later!)
// Initate the radar loop
/*world/New()
..()
spawn(10)
if(usr.activated == 1)
var/obj/O = new
O.icon = icon('Radar_Blips.dmi',"Radar")
O.screen_loc = "2,3" // Place the radar at the top-right corner of the screen
O.layer = 999 // Set it to a high layer so nothing appears over it
usr.client.screen += O
usr.client.radar = O*/
proc/Update_Radar()
for(var/client/C) // Loop through all non-npc players...
if(C.radar)
var/icon/R = icon('Radar_Blips.dmi',"Radar") // Create an icon to draw on
// R.DrawBox(rgb(0,128,0),0,0,32,32) // Clear the radar icon with a dark-ish green
R.DrawBox(rgb(255,255,255), 17, 17-3, 17, 17+3)
R.DrawBox(rgb(255,255,255), 17-2, 17, 17+2, 17)
for(var/obj/dragonball/M in world)
var/x = 16-(C.mob.x - M.x)+1
var/y = 16-(C.mob.y - M.y)+1
R.DrawBox(M.team, x-1, y-1, x+1, y+1) // Draw the blip at the proper x/y coordinates
C.radar.icon = R // Set the new icon onto the radar
spawn(3)
Update_Radar()
Problem description:
How would I make this scan through the whole world for the Dragonballs?
And yes I've given credit for using this demo, so nobody talk trash to me about using it...