public override void MoveTo(Vector location, double speed, Action doWhenArrived) { centerObject.MoveTo(location, speed, doWhenArrived); foreach (var obj in objects) { Vector displacement = obj.AbsolutePosition - centerObject.AbsolutePosition; obj.MoveTo(location + displacement, speed); } }
void LuoPutki(double x, double y) { double ht = Screen.Height; PyO putki = new PyO(10, ht); // Painovoima ei vaikuta putki.IgnoresPhysicsLogics = true; putki.CanRotate = false; // Ei törmäile maahan putki.CollisionIgnoreGroup = 1; putki.Position = new Vector(x, y); Add(putki); // Pistä putket tulemaan lintua kohti Vec movePos = new Vec(-ht, y); putki.MoveTo(movePos, 100); }
///<inheritdoc/> public override void MoveTo(Vector location, double speed, Action doWhenArrived) { centerObject.MoveTo(location, speed, doWhenArrived); }