Viikuna
No Marlo no game.
- Reaction score
- 265
One timer and struct array because its faster + it leaves you more instances of TimerUtils to be used where it is really needed.
I didnt see any reason why effect dont work. Add some debug msges to find the problem.
edit. That just how to calculate angle and sin and cos. Are you still looking answer for that? I think I missed some posts..
Ok, A is some point. Ax and Ay are its x and y coordinates. A is also the point where your attacking unit is standing. The other point, B, is where your 'soon to be knockbacked' unit is standing. Bx and By are his coordinates. Now when unit standing in point A, attacks and knocks unit standing in point B, you calculate the direction where that knocked unit must slide. dx and dy are distance in x coordinates and distance in y coordinates. You can use Atan2 to get angle, and SquareRoot(dx*dx+dy*dy) to get distance between A and B.
its just some math. ( Damn that Bolded text looks ugly :/ )
I didnt see any reason why effect dont work. Add some debug msges to find the problem.
edit. That just how to calculate angle and sin and cos. Are you still looking answer for that? I think I missed some posts..
Ok, A is some point. Ax and Ay are its x and y coordinates. A is also the point where your attacking unit is standing. The other point, B, is where your 'soon to be knockbacked' unit is standing. Bx and By are his coordinates. Now when unit standing in point A, attacks and knocks unit standing in point B, you calculate the direction where that knocked unit must slide. dx and dy are distance in x coordinates and distance in y coordinates. You can use Atan2 to get angle, and SquareRoot(dx*dx+dy*dy) to get distance between A and B.
its just some math. ( Damn that Bolded text looks ugly :/ )