diff --git a/scenes/sun.tscn b/scenes/sun.tscn index 42731ca..cd7a8c9 100644 --- a/scenes/sun.tscn +++ b/scenes/sun.tscn @@ -115,7 +115,7 @@ _data = { } [sub_resource type="CircleShape2D" id="CircleShape2D_7hl7x"] -radius = 19.0 +radius = 27.0 [node name="Sun" type="Area2D" node_paths=PackedStringArray("_deathTimer", "_rotation", "_fade")] material = SubResource("ShaderMaterial_u0o5k") diff --git a/scripts/Sun.cs b/scripts/Sun.cs index 8a6cfd8..44940ad 100644 --- a/scripts/Sun.cs +++ b/scripts/Sun.cs @@ -21,23 +21,11 @@ public partial class Sun : Area2D } public override void _InputEvent(Viewport viewport, InputEvent @event, int shapeIdx) { - if (scoring) return; + if (Settings.SunClick == false || scoring) return; if (@event.IsActionPressed("primary_action")) { - - _fade.Stop(); - scoring = true; - - GetNode("SunPlayer").Play(); - var tween = CreateTween(); - tween.TweenInterval(0.1); - tween.TweenProperty(this, "global_position", GetCanvasTransform().AffineInverse() * (Counter.GlobalPosition + Counter.PivotOffset), 0.5).SetTrans(Tween.TransitionType.Cubic).SetEase(Tween.EaseType.Out); - tween.TweenCallback(Callable.From(() => - { - RuntimeLevelData.Instance.AddSun(amount); - QueueFree(); - })); + ScoreSun(); } } @@ -49,4 +37,24 @@ public partial class Sun : Area2D _fade.Play("main"); } } + public override void _MouseEnter() + { + if (Settings.SunClick) return; + ScoreSun(); + } + private void ScoreSun() + { + _fade.Stop(); + scoring = true; + + GetNode("SunPlayer").Play(); + var tween = CreateTween(); + tween.TweenInterval(0.1); + tween.TweenProperty(this, "global_position", GetCanvasTransform().AffineInverse() * (Counter.GlobalPosition + Counter.PivotOffset), 0.5).SetTrans(Tween.TransitionType.Cubic).SetEase(Tween.EaseType.Out); + tween.TweenCallback(Callable.From(() => + { + RuntimeLevelData.Instance.AddSun(amount); + QueueFree(); + })); + } } diff --git a/scripts/static-data/Settings.cs b/scripts/static-data/Settings.cs index 7751e5f..43dd1d9 100644 --- a/scripts/static-data/Settings.cs +++ b/scripts/static-data/Settings.cs @@ -6,4 +6,5 @@ public partial class Settings : Node public static double SFX = 1.0f; public static double Music = 1.0f; public static bool Splash = false; + public static bool SunClick = false; }