public void setSpeed ( float speed ) { float currentSpeed = ( float ) Math . sqrt ( ( velx * velx ) + ( vely * vely ) ) ; velx *= speed ; vely *= speed ; velx /= currentSpeed ; vely /= currentSpeed ; }
Set the current speed of this particle