public override Replay Generate() { //add some frames at the beginning so the cursor doesnt suddenly appear on the first note Replay.Frames.Add(new TauReplayFrame(-100000, new Vector2(offset, offset + 150))); Replay.Frames.Add(new TauReplayFrame(Beatmap.HitObjects[0].StartTime - reactionTime, new Vector2(offset, offset + 150))); for (int i = 0; i < Beatmap.HitObjects.Count; i++) { TauHitObject h = Beatmap.HitObjects[i]; //Make the cursor stay at the last note's position if there's enough time between the notes if (i > 0 && h.StartTime - Beatmap.HitObjects[i - 1].StartTime > reactionTime) { float b = Beatmap.HitObjects[i - 1].PositionToEnd.GetDegreesFromPosition(new Vector2(5, 5)) * 4 * MathF.PI / 180; Replay.Frames.Add(new TauReplayFrame(h.StartTime - reactionTime, new Vector2(offset - (cursorDistance * MathF.Cos(b)), offset - (cursorDistance * MathF.Sin(b))))); buttonIndex = (int)TauAction.LeftButton; } float a = h.PositionToEnd.GetDegreesFromPosition(new Vector2(5, 5)) * 4 * MathF.PI / 180; Replay.Frames.Add(new TauReplayFrame(h.StartTime, new Vector2(offset - (cursorDistance * MathF.Cos(a)), offset - (cursorDistance * MathF.Sin(a))), (TauAction)(buttonIndex++ % 2))); } return(Replay); }
public DrawableHardBeat(TauHitObject hitObject) : base(hitObject) { Anchor = Anchor.Centre; Origin = Anchor.Centre; RelativeSizeAxes = Axes.Both; Size = Vector2.Zero; Alpha = 0f; AddRangeInternal(new Drawable[] { Circle = new CircularContainer { RelativeSizeAxes = Axes.Both, Size = new Vector2(1), Masking = true, BorderThickness = 5, BorderColour = Color4.White, Origin = Anchor.Centre, Anchor = Anchor.Centre, Alpha = 1f, Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Alpha = 0, AlwaysPresent = true }, } }, }); Position = Vector2.Zero; }
private Vector2 getEndCursorPosition(TauHitObject hitObject) { // Vector2 pos = hitObject.Position; Vector2 pos = Extensions.GetCircularPosition(10f, hitObject.Angle); //TODO: change 10f to radius of tau playfield and adjust sr elsewhere return(pos); }
public TauDifficultyHitObject(HitObject hitObject, HitObject lastLastObject, HitObject lastObject, double clockRate, IBeatmap bm) : base(hitObject, lastObject, clockRate) { this.lastLastObject = (TauHitObject)lastLastObject; this.lastObject = (TauHitObject)lastObject; this.beatmap = bm; setDistances(); // Every strain interval is hard capped at the equivalent of 375 BPM streaming speed as a safety measure StrainTime = Math.Max(50, DeltaTime); }
public override Replay Generate() { //add some frames at the beginning so the cursor doesnt suddenly appear on the first note Replay.Frames.Add(new TauReplayFrame(-100000, new Vector2(offset, offset + 150))); Replay.Frames.Add(new TauReplayFrame(Beatmap.HitObjects[0].StartTime - reactionTime, new Vector2(offset, offset + 150))); float prevAngle = 0; for (int i = 0; i < Beatmap.HitObjects.Count; i++) { TauHitObject h = Beatmap.HitObjects[i]; double releaseDelay = KEY_UP_DELAY; if (i + 1 < Beatmap.HitObjects.Count) { releaseDelay = Math.Min(KEY_UP_DELAY, Beatmap.HitObjects[i + 1].StartTime - h.StartTime); } switch (h) { case HardBeat _: Replay.Frames.Add(new TauReplayFrame(h.StartTime, ((TauReplayFrame)Replay.Frames.Last()).Position, TauAction.HardButton)); Replay.Frames.Add(new TauReplayFrame(h.StartTime + releaseDelay, ((TauReplayFrame)Replay.Frames.Last()).Position)); break; case Beat _: //Make the cursor stay at the last note's position if there's enough time between the notes if (i > 0 && h.StartTime - Beatmap.HitObjects[i - 1].StartTime > reactionTime) { Replay.Frames.Add(new TauReplayFrame(h.StartTime - reactionTime, Extensions.GetCircularPosition(cursorDistance, prevAngle) + new Vector2(offset))); buttonIndex = (int)TauAction.LeftButton; } Replay.Frames.Add(new TauReplayFrame(h.StartTime, Extensions.GetCircularPosition(cursorDistance, h.Angle) + new Vector2(offset), (TauAction)(buttonIndex++ % 2))); Replay.Frames.Add(new TauReplayFrame(h.StartTime + releaseDelay, Extensions.GetCircularPosition(cursorDistance, h.Angle) + new Vector2(offset))); prevAngle = h.Angle; break; } } return(Replay); }
public DrawableSlider(TauHitObject obj) : base(obj) { Size = new Vector2(768); Anchor = Anchor.Centre; Origin = Anchor.Centre; AddRangeInternal(new Drawable[] { maskingContainer = new CircularContainer { Masking = true, RelativeSizeAxes = Axes.Both, Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Alpha = 0, AlwaysPresent = true }, path = new SmoothPath { Anchor = Anchor.Centre, Origin = Anchor.Centre, PathRadius = 5, AutoSizeAxes = Axes.None, Size = TauPlayfield.BASE_SIZE }, headContainer = new Container <DrawableSliderHead> { RelativeSizeAxes = Axes.Both }, slidingSample = new PausableSkinnableSound { Looping = true } } }, }); }
public DrawableHardBeat(TauHitObject hitObject) : base(hitObject) { }
static void adjustFadeIn(TauHitObject h) => h.TimeFadeIn = h.TimePreempt * fade_in_duration_multiplier;