Make judgements scale with cs

This commit is contained in:
Kyle Chang 2018-09-22 22:54:38 -04:00
parent 5e51a50658
commit 7a43677849
3 changed files with 15 additions and 7 deletions

View File

@ -19,12 +19,15 @@ public class OsuPlayfield : Playfield
private readonly Container approachCircles;
private readonly JudgementContainer<DrawableOsuJudgement> judgementLayer;
private readonly ConnectionRenderer<OsuHitObject> connectionLayer;
private readonly OsuRulesetContainer rulesetContainer;
public static readonly Vector2 BASE_SIZE = new Vector2(512, 384);
public OsuPlayfield()
public OsuPlayfield(OsuRulesetContainer rulesetContainer)
: base(BASE_SIZE.X)
{
this.rulesetContainer = rulesetContainer;
Anchor = Anchor.Centre;
Origin = Anchor.Centre;
@ -69,10 +72,13 @@ private void onNewResult(DrawableHitObject judgedObject, JudgementResult result)
if (!judgedObject.DisplayResult || !DisplayJudgements)
return;
var explosionBaseSize = rulesetContainer.Beatmap.BeatmapInfo.BaseDifficulty.CircleSize;
DrawableOsuJudgement explosion = new DrawableOsuJudgement(result, judgedObject)
{
Origin = Anchor.Centre,
Position = ((OsuHitObject)judgedObject.HitObject).StackedEndPosition
Position = ((OsuHitObject)judgedObject.HitObject).StackedEndPosition,
Scale = new Vector2((1.0f - 0.7f * (explosionBaseSize - 5) / 5) / 2 * 1.65f)
};
judgementLayer.Add(explosion);

View File

@ -28,7 +28,7 @@ public OsuRulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap)
public override ScoreProcessor CreateScoreProcessor() => new OsuScoreProcessor(this);
protected override Playfield CreatePlayfield() => new OsuPlayfield();
protected override Playfield CreatePlayfield() => new OsuPlayfield(this);
public override PassThroughInputManager CreateInputManager() => new OsuInputManager(Ruleset.RulesetInfo);

View File

@ -65,13 +65,15 @@ protected override void LoadComplete()
this.FadeInFromZero(100, Easing.OutQuint);
var origScale = Scale;
switch (Result.Type)
{
case HitResult.None:
break;
case HitResult.Miss:
this.ScaleTo(1.6f);
this.ScaleTo(1, 100, Easing.In);
this.ScaleTo(origScale * 1.6f);
this.ScaleTo(origScale, 100, Easing.In);
this.MoveToOffset(new Vector2(0, 100), 800, Easing.InQuint);
this.RotateTo(40, 800, Easing.InQuint);
@ -79,8 +81,8 @@ protected override void LoadComplete()
this.Delay(600).FadeOut(200);
break;
default:
this.ScaleTo(0.9f);
this.ScaleTo(1, 500, Easing.OutElastic);
this.ScaleTo(origScale * 0.9f);
this.ScaleTo(origScale, 500, Easing.OutElastic);
this.Delay(100).FadeOut(400);
break;