Ejemplo n.º 1
0
        public override void Think()
        {
            base.Think();

            if (World.DistanceOutOfBounds(Position) > 0)
            {
                var speed = Momentum.Length();
                if (Position != Vector2.Zero)
                {
                    Momentum = Vector2.Normalize(Vector2.Zero - Position) * speed;
                }
            }
        }
Ejemplo n.º 2
0
        public override void Think()
        {
            base.Think();


            if (TimeDeath > 0 && TimeDeath < World.Time)
            {
                this.PendingDestruction = true;
            }

            if (World.DistanceOutOfBounds(Position) > 0)
            {
                var speed = Momentum.Length();
                if (Position != Vector2.Zero)
                {
                    Momentum = Vector2.Normalize(Vector2.Zero - Position) * speed;
                }
            }

            if (Drag != 1)
            {
                Momentum *= Drag;
            }
        }