share/hedgewars/Data/Scripts/Multiplayer/WxW.lua
changeset 14811 d65e25e211d4
parent 14773 a9f32ff53389
child 15068 6f51c75994a4
equal deleted inserted replaced
14810:583d8b96fb30 14811:d65e25e211d4
   722 	-- work out the distance to the target
   722 	-- work out the distance to the target
   723 	g1X, g1Y = GetGearPosition(CurrentHedgehog)
   723 	g1X, g1Y = GetGearPosition(CurrentHedgehog)
   724 	g2X, g2Y = GetX(gear), GetY(gear)
   724 	g2X, g2Y = GetX(gear), GetY(gear)
   725 	q = g1X - g2X
   725 	q = g1X - g2X
   726 	w = g1Y - g2Y
   726 	w = g1Y - g2Y
       
   727 	-- Floating point operations are safe, it's only for visuals
   727 	r = math.sqrt( (q*q) + (w*w) )	--alternate
   728 	r = math.sqrt( (q*q) + (w*w) )	--alternate
   728 
   729 
   729 	RCX = getGearValue(gear,"RX")
   730 	RCX = getGearValue(gear,"RX")
   730 	RCY = getGearValue(gear,"RY")
   731 	RCY = getGearValue(gear,"RY")
   731 
   732