AdamGriffith
You can change this now in User CP.
- Reaction score
- 69
JASS:
function Slide_SVT_01 takes real displacement, real final_velocity, real time, unit u returns nothing
local timer t1 = CreateTimer()
set udg_S = displacement
set udg_V = final_velocity
set udg_T = time
set udg_U = (udg_S / (0.5 * udg_T)) - udg_V
set udg_A = (udg_S - (udg_V * udg_T)) / (-0.5 * Pow(udg_T, 2))
set udg_Unit = u
set udg_Point = GetUnitLoc(udg_Unit)
call TimerStart(t1, 0.035, true, function Slide_SVT_02)
endfunction
JASS:
function Slide_SVT_02 takes nothing returns nothing
local real distance = (udg_U * udg_Real) + (0.5 * udg_A * Pow(udg_Real, 2))
local location point = PolarProjectionBJ(udg_Point, distance, GetUnitFacing(udg_Unit))
local timer t1 = GetExpiredTimer()
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS, R2S(distance))
call SetUnitPositionLoc(udg_Unit, point)
if udg_Real >= udg_T then
call DestroyTimer(t1)
set udg_Real = 0
else
set udg_Real = udg_Real + 0.035
endif
call RemoveLocation(point)
endfunction
JASS:
call Slide_SVT_01(displacement, final_velocity, time, u)