using Godot; namespace AceField.Scripts; public partial class Brick : StaticBody2D { [Export] public int MaxDecayProgress = 50; [Export] public int DecayProgress; public override void _Ready() { DecayProgress = MaxDecayProgress; GetNode("DecayTimer").Timeout += () => { DecayProgress--; if (DecayProgress > 0) return; GetNode("DecayTimer").Stop(); QueueFree(); }; } public override void _Process(double delta) { var sprite = GetNode("Sprite2D"); sprite.SelfModulate = new Color(sprite.SelfModulate, (float)DecayProgress / MaxDecayProgress); } }