local Vector2 = require("#microsoft.xna.framework.vector2")


function onStay()
  something = celeste.Mod.MaxHelpingHand.Entities.MoreCustomNPC.GetNPC("something")
  something:PlayAnimation("move_something")
  something.Depth = -10001

  if something.position.X < (player.Position.X + 60) and something.position.X > (player.Position.X - 60) then
    something.Position = Vector2.Lerp(something.Position, (player.Position + vector2(0, 20)), monocle.Ease.Linear(0.025))
  end

  if player.Position.X < something.Position.X then
    something:SetHorizontalScale(-1)
  end

  if player.Position.X > something.Position.X then
    something:SetHorizontalScale(1)
  end

  if something.position.X < (player.Position.X + 8) and something.position.X > (player.Position.X - 8) and something.position.Y > (player.Position.Y + 8) then
    setFlag("fade_deeperwell_scareaway_end")
  end

end