mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-13 16:05:55 +00:00
Death animations and spawner
This commit is contained in:
parent
4fd31d7988
commit
16b7d936c9
13 changed files with 286 additions and 11 deletions
28
Scripts/Actors/AlarmTeleporterActorSpawner.cs
Normal file
28
Scripts/Actors/AlarmTeleporterActorSpawner.cs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
using Cirno.Scripts.Activables;
|
||||
using Godot;
|
||||
|
||||
namespace Cirno.Scripts.Actors;
|
||||
|
||||
public partial class AlarmTeleporterActorSpawner : ActorSpawner
|
||||
{
|
||||
private AlarmManager _alarmManager;
|
||||
|
||||
[Export]
|
||||
public Teleporter Teleporter { get; private set; }
|
||||
|
||||
[Export]
|
||||
public float ActivationRange { get; private set; }
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
_alarmManager = this.GetAlarmManager();
|
||||
_alarmManager.AlarmEnabled += AlarmManagerOnAlarmEnabled;
|
||||
}
|
||||
|
||||
private void AlarmManagerOnAlarmEnabled(Vector2 location)
|
||||
{
|
||||
if (!(location.DistanceTo(this.GlobalPosition) <= ActivationRange)) return;
|
||||
Teleporter?.FireParticles();
|
||||
Spawn();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue