|
有两个水平同心圆,在相反方向上运行.
3个垂直圆,在绕中心公转的同时,还在自转.
(有点像星系里的概念吧,比如月球在绕太阳公转的同时,还在绕地球转)
[codes=jass]
globals
unit array wisp
real angle=0
real height=200
real radius=200
real speed=0.02
real height_temp=0
constant real step=bj_PI/6
endglobals
function flying takes nothing returns nothing
local integer index=0
local real temp=0
set angle=angle+speed
loop
exitwhen index==12
set temp=step*index+angle
call SetUnitXYZ(wisp[index],radius*Cos(temp),radius*Sin(temp),height)
call SetUnitXYZ(wisp[index+48],1.5*radius*Cos(-temp),1.5*radius*Sin(-temp),height)
set height_temp=0.6*(height+radius*Sin(temp))
call SetUnitXYZ(wisp[index+12],radius*(1.33333333+0.6*Cos(temp))*Cos(angle/2), radius*(1.33333333+0.6*Cos(temp))*Sin(angle/2), height_temp)
call SetUnitXYZ(wisp[index+24],radius*(1.33333333+0.6*Cos(temp))*Cos(angle/2+4*step),radius*(1.33333333+0.6*Cos(temp))*Sin(angle/2+4*step),height_temp)
call SetUnitXYZ(wisp[index+36],radius*(1.33333333+0.6*Cos(temp))*Cos(angle/2+8*step),radius*(1.33333333+0.6*Cos(temp))*Sin(angle/2+8*step),height_temp)
set index=index+1
endloop
endfunction
function Trig_fly_Actions takes nothing returns nothing
local integer index=0
loop
exitwhen index==60
set wisp[index]=CreateUnit(Player(2),'ewsp',0,0,0)
call SetUnitColor(wisp[index],ConvertPlayerColor(index-(index/12)*12))
call UnitFlyAble(wisp[index])
set index=index+1
endloop
call TimerRun(function flying,0.02,true)
endfunction
[/codes] |
评分
-
查看全部评分
|