Beeg checkin
This commit is contained in:
31
Player/Sagittarius/Attacks/MegamiBeamShot.cs
Normal file
31
Player/Sagittarius/Attacks/MegamiBeamShot.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using Godot;
|
||||
using System.Linq;
|
||||
|
||||
public partial class MegamiBeamShot : Projectile
|
||||
{
|
||||
[Export]
|
||||
private PathFollow3D _pathFollow;
|
||||
[Export]
|
||||
public new AudioStream _soundEffect;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
_pathFollow = GetNode<PathFollow3D>("Path3D/PathFollow3D");
|
||||
_pathFollow.GetParentNode3D().Rotation = ParentCharacter.GetNode<Node3D>("Pivot").Rotation;
|
||||
var sfxPlayer = GetTree().Root.GetNode<AudioStreamPlayer>("Main/SFXPlayer");
|
||||
sfxPlayer.Stream = _soundEffect;
|
||||
sfxPlayer.Play();
|
||||
}
|
||||
|
||||
public override void _PhysicsProcess(double delta)
|
||||
{
|
||||
_pathFollow.Progress += 10f * (float)delta;
|
||||
if (Mathf.IsEqualApprox(_pathFollow.ProgressRatio, 1.0f))
|
||||
QueueFree();
|
||||
}
|
||||
|
||||
private void OnBulletHitObject(Node node)
|
||||
{
|
||||
QueueFree();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user