Beispiel #1
0
        protected override void Update()
        {
            base.Update();

            if (Head.IsHit || HasBroken.Value)
            {
                holdStar.Show();
            }
            else
            {
                holdStar.Hide();
            }

            float targetRatio = 0;

            if (HoldStartTime != null)
            {
                var targetTime = HoldEndTime ?? Time.Current;
                targetRatio = (float)Math.Clamp((targetTime - HitObject.StartTime) / HitObject.Duration, 0, 1);
            }

            bodyContainer.Width = 1 - targetRatio;
            holdStar.Y          = DrawHeight / 2f;
            holdStar.X          = DrawWidth * targetRatio;
        }
Beispiel #2
0
        protected override void Update()
        {
            base.Update();

            if (Head.IsHit)
            {
                holdStar.Show();
            }
            else
            {
                holdStar.Hide();
            }

            holdStar.X = DrawWidth * (float)Progress;
            holdStar.Y = DrawHeight / 2f;

            // Keep the body piece width in-line with ours and
            // start cutting its container's width as we hold it.
            BodyPiece.Width     = DrawWidth;
            bodyContainer.Width = 1 - (float)Progress;
        }