Beeg checkin
This commit is contained in:
29
Player/Base/Projectile.cs
Normal file
29
Player/Base/Projectile.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using Godot;
|
||||
|
||||
public partial class Projectile : Node3D
|
||||
{
|
||||
[Export]
|
||||
public double Cooldown { get; protected set; }
|
||||
[Export]
|
||||
public AudioStream _soundEffect;
|
||||
|
||||
public Controls ParentCharacter;
|
||||
|
||||
[Export]
|
||||
private float _projectileSpeed = 1f;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
Speed = _projectileSpeed;
|
||||
var sfxPlayer = GetTree().Root.GetNode<AudioStreamPlayer>("Main/SFXPlayer");
|
||||
sfxPlayer.Stream = _soundEffect;
|
||||
sfxPlayer.Play();
|
||||
}
|
||||
|
||||
public float Speed { get; private set; }
|
||||
|
||||
public void OnTimeToLiveTimeout()
|
||||
{
|
||||
QueueFree();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user