- Joined
- Mar 29, 2012
- Messages
- 542
How do I find the length of x and y?
I have a projectile that move by 30 on every iteration towards target but I want to apply that 30 to the parabola plane instead to the line straight to the target.
I used this function to make the arc projection:
JASS:
function Parabola takes real h, real d, real x returns real
return (4. * h / d) * (d - x) * (x / d)
endfunction
// 'h' is the max height
// 'd' is the distance to target (max distance)
// 'x' is the currently traveled distance at the time when it is iterated
So it would be like this on every iteration:
JASS:
// --- Set projectile position + [speed] towards target
// --- Set projectile position (z) + Parabola([max height], [max distance], [traveled distance])
Last edited: