Ejemplo n.º 1
0
 private static Ball getBallCopy(Ball targetBall, FieldSimulation fs)
 {
     var copy = new Ball(fs);
     copy.x = targetBall.x;
     copy.y = targetBall.y;
     copy.stealthMode = targetBall.stealthMode;
     copy.dead = targetBall.dead;
     copy.setVector(targetBall.getCurrentAngle());
     if (targetBall.wiggler.wiggling) //copy wiggling params
     {
         copy.goWiggle();
         copy.wiggler.currentShiftX = targetBall.wiggler.currentShiftX;
         copy.wiggler.currentShiftY = targetBall.wiggler.currentShiftY;
         copy.wiggler.currentPerpendicularAngle = targetBall.wiggler.currentPerpendicularAngle;
         copy.wiggler.currentStepNumber = targetBall.wiggler.currentStepNumber;
     }
     return copy;
 }