Can I somehow make this a bit cleaner using
Math.[Somthing], without making a method for it !?
int MaxSpeed = 50; if (Speed.X > MaxSpeed) Speed.X = MaxSpeed; if (Speed.X < MaxSpeed * -1) Speed.X = MaxSpeed * -1; if (Speed.Y > MaxSpeed) Speed.Y = MaxSpeed; if (Speed.Y < MaxSpeed * -1) Speed.Y = MaxSpeed * -1;
It is probably been asked before, but my English is not that great, don't know what to search for.