I think this looks quite bad...Its not as smooth as I hoped.
Im not sure how could you make the ability smoother, since you dont want to be too slow and it should look like a natural jump.
I quess that would work for a tutorial anyway. You can propably figure way to make the jump look better with changing the values.
edit* If you want to make leap spell look like a half circle instead of triangle, you can also use mathetmatic functions like sin. Then you dont even need to detect when unit starts to go down.
example:
5*Sin(4*tmpReal) = units flying height;
where 5 = amplitude(how hight the unit will go),
(4*tmpReal) = how fast will the unit rise/lower itself (tmpReal is used inside the loop to increase the value, like this; tmpReal = tmpReal + 1).
I dont remember too mucha bout math, but I think this formula produces good results too and simplifies the leap spell.
I dont bother explaining how the sin works, but you should test it out. NO NEED FOR DETECTING UNIT GOING DOWN/UP
I think this looks quite bad...Its not as smooth as I hoped.
Im not sure how could you make the ability smoother, since you dont want to be too slow and it should look like a natural jump.
I quess that would work for a tutorial anyway. You can propably figure way to make the jump look better with changing the values.
example:
5*Sin(4*tmpReal) = units flying height;
where 5 = amplitude(how hight the unit will go),
(4*tmpReal) = how fast will the unit rise/lower itself (tmpReal is used inside the loop to increase the value, like this; tmpReal = tmpReal + 1).
I dont remember too mucha bout math, but I think this formula produces good results too and simplifies the leap spell.
I dont bother explaining how the sin works, but you should test it out. NO NEED FOR DETECTING UNIT GOING DOWN/UP