So after attempting to use processing, I decided to come back to wc3 and attempt to implement vectors in a projectile system I am making.
My question is:
Does anyone know how to limit the speed of a projectile that uses vectors to move?
I will try to explain it for now, as I can't post the code until I get on another computer...
Basically, I use a vector for the position of the projectile, a vector for projectile velocity and a vector for gravity.
Projectiles can bounce off the ground and walls etc, and depending on the angle at which they bounce, the velocity vector will get increased / decreased dramatically, resulting in either speeding up the projectile or slowing it down.
What I want is to keep the projectile at a constant speed while it moves, so bounces and angles to not affect the speed.
I will post my projectile system and vector system when I can.
My question is:
Does anyone know how to limit the speed of a projectile that uses vectors to move?
I will try to explain it for now, as I can't post the code until I get on another computer...
Basically, I use a vector for the position of the projectile, a vector for projectile velocity and a vector for gravity.
Projectiles can bounce off the ground and walls etc, and depending on the angle at which they bounce, the velocity vector will get increased / decreased dramatically, resulting in either speeding up the projectile or slowing it down.
What I want is to keep the projectile at a constant speed while it moves, so bounces and angles to not affect the speed.
I will post my projectile system and vector system when I can.