public override void Update(GameTime gameTime) { if (body.LinearVelocity.Length() > 0.001f) { body.LinearVelocity = Vector2.Normalize(body.LinearVelocity) * speed; oldLinearVelocity = body.LinearVelocity; } else if (oldLinearVelocity != Vector2.Zero) { body.LinearVelocity = Vector2.Normalize(-oldLinearVelocity) * speed; } ResolveVerticalAndHorizontalVelocities(); if (body.Position.Y > maxY) { Destroy(); } trail.Update(gameTime); trail.Position = ConvertUnits.ToDisplayUnits(body.Position); justCollided = false; }
public override void Update(GameTime gameTime) { trail.Update(gameTime); trail.Position = ConvertUnits.ToDisplayUnits(Position); if (Position.Y < 0) { Destroy(); } }