Audio system and rich text
This commit is contained in:
parent
a6f817efbc
commit
68cafff083
161 changed files with 1605 additions and 255 deletions
|
|
@ -19,6 +19,7 @@ public partial class ExplosionComponent : Area2D
|
|||
|
||||
PoolContainer.Instance.SpawnParticles(particles, GetParent<RuntimePlantData>().GlobalPosition);
|
||||
|
||||
GetNode<ChannelPlayer>("ExplosionPlayer").Play();
|
||||
GetParent<RuntimePlantData>().Kill();
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue