First builds and stuff done yipewaho
This commit is contained in:
@@ -3,22 +3,28 @@ using System.Collections.Generic;
|
||||
|
||||
public partial class EnemySpawner : Node
|
||||
{
|
||||
public static EnemySpawner Instance;
|
||||
|
||||
[Export] private Node _pathParent;
|
||||
[Export] private EnemyPool _pool;
|
||||
|
||||
private readonly List<Path2D> _paths = new();
|
||||
|
||||
public int EnemiesSpawned = 0;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
Instance = this;
|
||||
|
||||
foreach (var c in _pathParent.GetChildren())
|
||||
if (c is Path2D p)
|
||||
_paths.Add(p);
|
||||
|
||||
for (int i = 0; i < 10; i++)
|
||||
SpawnWithDelay(i * 0.33f);
|
||||
// for (int i = 0; i < 10; i++)
|
||||
// SpawnWithDelay(i * 0.33f);
|
||||
}
|
||||
|
||||
private async void SpawnWithDelay(float t)
|
||||
public async void SpawnWithDelay(float t)
|
||||
{
|
||||
await ToSignal(GetTree().CreateTimer(t), SceneTreeTimer.SignalName.Timeout);
|
||||
Spawn();
|
||||
|
||||
Reference in New Issue
Block a user