public override void Update(GameTime gameTime) { _swimmers.ForEach((swimmer) => { float yDiff = GameObject.Position.Y - swimmer.Position.Y; if (yDiff <= 0.0f) { swimmer.SendMessage("ChangeMotionState", new object[] { Pontification.Physics.DynamicObject.MotionStates.MS_MIDAIR }); swimmer.SendMessage("SetVelocity", new object[] { _physics.GetVelocity() }); } }); }
public override void Update(GameTime gameTime) { if (_physics.IsStatic == false) { var velocity = _physics.GetVelocity(); if (velocity.Y == 0 && _previousVelocity.Y >= _treasholdVelocity) { AddImpulse(); } _previousVelocity = velocity; } }