Audio system and rich text

This commit is contained in:
Rendo 2025-06-29 14:28:51 +05:00
commit 68cafff083
161 changed files with 1605 additions and 255 deletions

View file

@ -19,6 +19,7 @@ public partial class ExplosionComponent : Area2D
PoolContainer.Instance.SpawnParticles(particles, GetParent<RuntimePlantData>().GlobalPosition);
GetNode<ChannelPlayer>("ExplosionPlayer").Play();
GetParent<RuntimePlantData>().Kill();
}

View file

@ -17,12 +17,15 @@ public partial class RuntimePlantData : Node2D, IEntity
public int Line { get; set; }
public PlantResource Resource;
private AudioStream eatenSound;
[Signal]
public delegate void OnHPChangedEventHandler(int amount, Node origin);
public override void _Ready()
{
_hp = _maxHP;
eatenSound = ResourceLoader.Load<AudioStream>("res://assets/audio/sfx/gulp.mp3");
}
public virtual void Heal(int amount, Node origin)
@ -46,6 +49,7 @@ public partial class RuntimePlantData : Node2D, IEntity
if (_hp <= 0)
{
Kill();
AudioSequencer.Play("plant_eaten", eatenSound);
}
}
public virtual void Kill()