Re: как создать карту-радар ??
простой радар для ботов.
Type bot
Fileld entity ; ентити бота
. . .
. . .
Field dst# ; дистанция бота от игрока
End Type
. . .
; После RenderWorld
For b.bot=Each bot
b\dst=EntityDistance(b\entity,Player)
If b\dst<150
oy=Sin(270-DeltaYaw(Player,b\entity))*b\dst
ox=Cos(270-DeltaYaw(Player,b\entity))*b\dst
Else
ox=0:oy=0
EndIf
Color 255,0,0
Oval GraphicsWidth()-102+ox*0.5,98+oy*0.5,4,4,1 ;точка бота
Next
; рисуем радар
Color 0,255,0
Oval GraphicsWidth()-180,20,160,160,0
Oval GraphicsWidth()-102,98,4,4,1 ; игрок
Line GraphicsWidth()-100,100,GraphicsWidth()-100+Sin(-130)*80,100+Cos(+130)*80
Line GraphicsWidth()-100,100,GraphicsWidth()-100+Sin(+130)*80,100+Cos(-130)*80
выделенные значения нужно откалибровать, чтобы точки не рисовались за пределами круга
|