public override void step()
{
Velocity.Y += FallSpeed;
if (Collides(position + Vector2.UnitY))
{
Velocity.Y = 0;
position.Y = (float)Math.Floor(position.Y);
Velocity.X /= 1.2f;
}
Velocity.X /= 1.1f;
if (Collides(position + Velocity))
{
Velocity = Vector2.Zero;
}
position += Velocity;
if (Vector2.Distance(Player.LocalClient.position, position) <= 3)
{
position = Vector2.Lerp(position, Player.LocalClient.position, 0.1f);
}
if (Vector2.Distance(Player.LocalClient.position, position) <= 0.3f)
{
SoundManager.PlaySound(SoundManager.SfxCoinPickup);
destroy();
}
}