mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-14 10:13:47 +00:00
Sound effects
This commit is contained in:
parent
80a13d047d
commit
60ab375572
41 changed files with 504 additions and 15 deletions
|
|
@ -10,7 +10,7 @@ public partial class ForceField : Door
|
|||
|
||||
[Export]
|
||||
public Material ActiveMaterial { get; private set; }
|
||||
|
||||
|
||||
// Disable
|
||||
public override void Open()
|
||||
{
|
||||
|
|
@ -19,7 +19,6 @@ public partial class ForceField : Door
|
|||
|
||||
_animatedSprite.Material = TurnOffMaterial;
|
||||
//((ShaderMaterial)_animatedSprite.Material).Shader = TurnOffShader;
|
||||
|
||||
_ = AnimateShutdownAsync();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -35,6 +35,9 @@ public partial class Teleporter : Activable
|
|||
|
||||
protected GpuParticles2D _particles;
|
||||
|
||||
private AudioStreamPlayer2D _teleportStartSound;
|
||||
private AudioStreamPlayer2D _teleportEndSound;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
_particles = GetNode<GpuParticles2D>("./Particles");
|
||||
|
|
@ -54,6 +57,9 @@ public partial class Teleporter : Activable
|
|||
{
|
||||
_animatedSprite.Play("Default");
|
||||
}
|
||||
|
||||
_teleportStartSound = GetNodeOrNull<AudioStreamPlayer2D>("TeleportStart");
|
||||
_teleportEndSound = GetNodeOrNull<AudioStreamPlayer2D>("TeleportEnd");
|
||||
}
|
||||
|
||||
public override void _Process(double delta)
|
||||
|
|
@ -133,6 +139,8 @@ public partial class Teleporter : Activable
|
|||
|
||||
await TweenPlayer(player);
|
||||
|
||||
PlayTeleportStartSound();
|
||||
|
||||
//_particles.Emitting = true;
|
||||
FireParticles();
|
||||
|
||||
|
|
@ -142,12 +150,22 @@ public partial class Teleporter : Activable
|
|||
|
||||
Target.PrepareForReceiving();
|
||||
player.GlobalPosition = Target.GlobalPosition + TeleportOffset;
|
||||
|
||||
Target.PlayTeleportEndSound();
|
||||
await player.UnTeleport();
|
||||
|
||||
player.RequestMovementDisable(false);
|
||||
}
|
||||
|
||||
public void PlayTeleportStartSound()
|
||||
{
|
||||
_teleportStartSound?.Play();
|
||||
}
|
||||
|
||||
public void PlayTeleportEndSound()
|
||||
{
|
||||
_teleportEndSound?.Play();
|
||||
}
|
||||
|
||||
protected async Task TweenPlayer(PlayerMovement player)
|
||||
{
|
||||
await player.TweenGlobalPosition(GlobalPosition + new Vector2(0, -4f), TeleportAnimationLength).PlayAsync(CancellationToken.None);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue