add GetSpeed counterpart to SetSpeed

epoxy
Maikel de Vries 2016-02-03 14:48:30 +01:00
parent 92e03d8fdd
commit 17fae9c77b
1 changed files with 6 additions and 0 deletions

View File

@ -13,6 +13,12 @@ global func SetSpeed(int x_dir, int y_dir, int prec)
return;
}
// Returns the speed of an object.
global func GetSpeed(int prec)
{
return Sqrt(GetXDir(prec)**2 + GetYDir(prec)**2);
}
// Sets an objects's speed and its direction, doesn't it?
// Can set either speed or angle of velocity, or both
global func SetVelocity(int angle, int speed, int precAng, int precSpd)