war and murder

This commit is contained in:
2023-09-02 11:25:49 -07:00
parent 3b8e6b34c9
commit 7f7595b06d
8 changed files with 130 additions and 18 deletions

23
Scripts/FireAtPlayer.cs Normal file
View File

@@ -0,0 +1,23 @@
using Godot;
public partial class FireAtPlayer : Timer
{
[Export]
private Node3D _enemy;
[Export]
private PackedScene _fireProjectile;
public void OnFireAtPlayer()
{
GD.Print("Fire at player");
var projectile = _fireProjectile.Instantiate<Projectile>() as EnemyBullet;
projectile.Rotation = _enemy.Rotation;
projectile.Position = _enemy.Position;
GetParent().AddChild(projectile);
}
private void OnDied()
{
Stop();
}
}