Add RecoilComponent and SquashAndStretchComponent; implement recoil and animation effects on shooting

This commit is contained in:
2025-09-13 14:18:43 +02:00
parent e6f8989d16
commit 03abf91f59
7 changed files with 144 additions and 3 deletions

View File

@@ -12,6 +12,8 @@ public partial class PeriodicShootingComponent : Node
[Export] public Node2D BulletSpawnPointRight { get; set; }
[Export] public Node2D BulletSpawnPointLeft { get; set; }
[Export] public float ShootingIntervalVariation { get; set; } = 0.0f;
[Signal] public delegate void ShotFiredEventHandler(Vector2 shootDirection);
private Timer _timer;
private RandomNumberGenerator _rng;
@@ -84,5 +86,6 @@ public partial class PeriodicShootingComponent : Node
bulletInstance.GlobalPosition = spawnPosition;
GetTree().CurrentScene.AddChild(bulletInstance);
EmitSignalShotFired(ShootDirection);
}
}