sun is now scored on hover

This commit is contained in:
Rendo 2025-07-19 19:03:41 +05:00
commit 0d0e16afa2
3 changed files with 24 additions and 15 deletions

View file

@ -115,7 +115,7 @@ _data = {
} }
[sub_resource type="CircleShape2D" id="CircleShape2D_7hl7x"] [sub_resource type="CircleShape2D" id="CircleShape2D_7hl7x"]
radius = 19.0 radius = 27.0
[node name="Sun" type="Area2D" node_paths=PackedStringArray("_deathTimer", "_rotation", "_fade")] [node name="Sun" type="Area2D" node_paths=PackedStringArray("_deathTimer", "_rotation", "_fade")]
material = SubResource("ShaderMaterial_u0o5k") material = SubResource("ShaderMaterial_u0o5k")

View file

@ -21,11 +21,29 @@ public partial class Sun : Area2D
} }
public override void _InputEvent(Viewport viewport, InputEvent @event, int shapeIdx) public override void _InputEvent(Viewport viewport, InputEvent @event, int shapeIdx)
{ {
if (scoring) return; if (Settings.SunClick == false || scoring) return;
if (@event.IsActionPressed("primary_action")) if (@event.IsActionPressed("primary_action"))
{ {
ScoreSun();
}
}
public override void _Process(double delta)
{
if (scoring) return;
if (_deathTimer.TimeLeft / _deathTimer.WaitTime <= 0.25)
{
_fade.Play("main");
}
}
public override void _MouseEnter()
{
if (Settings.SunClick) return;
ScoreSun();
}
private void ScoreSun()
{
_fade.Stop(); _fade.Stop();
scoring = true; scoring = true;
@ -39,14 +57,4 @@ public partial class Sun : Area2D
QueueFree(); QueueFree();
})); }));
} }
}
public override void _Process(double delta)
{
if (scoring) return;
if (_deathTimer.TimeLeft / _deathTimer.WaitTime <= 0.25)
{
_fade.Play("main");
}
}
} }

View file

@ -6,4 +6,5 @@ public partial class Settings : Node
public static double SFX = 1.0f; public static double SFX = 1.0f;
public static double Music = 1.0f; public static double Music = 1.0f;
public static bool Splash = false; public static bool Splash = false;
public static bool SunClick = false;
} }