enemies spawn held in place

This commit is contained in:
Ian Woods 2026-06-23 22:21:32 -07:00
parent 54f11d91ff
commit ff921080db
4 changed files with 75 additions and 26 deletions

View file

@ -5,8 +5,7 @@ using UnityEngine;
namespace TD.Gameplay
{
/// <summary>
/// A single spawn group within a wave: one enemy type, how many of them,
/// and how long to wait between each spawn.
/// A single spawn group within a wave: one enemy type and how many of them.
/// </summary>
[Serializable]
public struct WaveEntry
@ -16,10 +15,6 @@ namespace TD.Gameplay
[Tooltip("How many enemies of this type to spawn.")]
public int Count;
[Tooltip("Seconds between each burst. Enemies spawn in bursts of 10% of Count at a time.")]
public float SpawnInterval;
}
/// <summary>
@ -29,16 +24,21 @@ namespace TD.Gameplay
/// <remarks>
/// Entries are processed in array order. Multiple entries let designers mix enemy
/// types within one wave (e.g. 10 fast scouts followed by 3 armoured brutes).
/// The wave is not considered complete until all spawned enemies are dead or have
/// leaked — not just until all entries are spawned.
/// All enemies spawn held at wave start; they are released in 10% chunks separated
/// by <see cref="ReleaseInterval"/> seconds. The wave is not complete until all
/// enemies are dead or have leaked.
/// </remarks>
[CreateAssetMenu(fileName = "WaveDefinition", menuName = "TD/Wave Definition", order = 4)]
public class WaveDefinition : ScriptableObject
{
[Tooltip("Seconds between the wave-number advancing (start of prep) and the " +
"first enemy spawning. Gives players time to build before the wave hits.")]
"first enemies becoming visible. Gives players time to build before the horde appears.")]
public float PrepTime = 10f;
[Tooltip("Seconds between each chunk release. All enemies spawn held at wave " +
"start and are released 10% at a time on this interval.")]
public float ReleaseInterval = 2f;
[Tooltip("Enemy groups that make up this wave. Processed in order.")]
public WaveEntry[] Entries;
}