using Godot;
using static ld48.Extensions;

public class Mushrooms : Node2D {
    private Particles2D particles;
    
    public override void _Ready() {
        base._Ready();

        particles = GetNode<Particles2D>("Particles");
    }

    public void Entered(Node body) {
        if (body is Hero hero) {
            particles.Emitting = true;
            hero.inSave = true;
            hero.lastSave = this;
        }
    }
    
    public void Exited(Node body) {
        if (body is Hero hero) {
            particles.Emitting = false;
            hero.inSave = false;
        }
    }
}

