Exemplo n.º 1
0
        protected override IEnumerable <CytosuHitObject> ConvertHitObject(HitObject original, IBeatmap beatmap, CancellationToken cancellationToken)
        {
            var progression = CytosuUtils.GetYProgressionFromBeatmap(beatmap, original.StartTime);

            float x = ((IHasXPosition)original).X;
            float y = progression.yPosition * 384;

            switch (original)
            {
            case IHasDuration endTimeData:
                return(new Hold
                {
                    Samples = original.Samples,
                    StartTime = original.StartTime,
                    EndTime = endTimeData.EndTime,
                    Position = new Vector2(x, y),
                    Direction = progression.direction
                }.Yield());

            default:
                return(new HitCircle
                {
                    Samples = original.Samples,
                    StartTime = original.StartTime,
                    Position = new Vector2(x, y),
                    Direction = progression.direction
                }.Yield());
            }
        }
Exemplo n.º 2
0
        private float updateScanLinePosition()
        {
            float beatProgression = (float)(TimeSinceLastBeat / (TimeSinceLastBeat + TimeUntilNextBeat));

            //Handle case where beat index below zero. Not sure about this approach
            return(CytosuUtils.GetYProgression(beatIndex, beatProgression).yPosition);
        }