mini_arcade_core.scenes.systems.builtins.spawn

Reusable spawn and wave progression systems.

Classes

SpawnBinding

Declarative spawn rule for one spawn source.

SpawnSystem

Execute reusable spawn rules and insert spawned entities into the world.

WaveProgressionBinding

Declarative wave/lap/round progression rule.

WaveProgressionSystem

Advance wave state and optionally spawn the next batch when complete.

Module Contents

class mini_arcade_core.scenes.systems.builtins.spawn.SpawnBinding[source]

Bases: Generic[TCtx]

Declarative spawn rule for one spawn source.

should_spawn: Callable[[TCtx], bool]
spawn: Callable[[TCtx], SpawnResult]
on_spawned: Callable[[TCtx, tuple[mini_arcade_core.engine.entities.BaseEntity, Ellipsis]], None] | None = None
insert_into_world: bool = True
class mini_arcade_core.scenes.systems.builtins.spawn.SpawnSystem[source]

Bases: Generic[TCtx]

Execute reusable spawn rules and insert spawned entities into the world.

name: str = 'common_spawn'
phase: int
order: int = 25
enabled_when: Callable[[TCtx], bool]
bindings: tuple[SpawnBinding[TCtx], Ellipsis] = ()
step(ctx: TCtx) None[source]

Execute the spawn rules for each binding.

Parameters:

ctx (TCtx) – The context object passed to the system, typically containing references to the world, scene, and other relevant state.

class mini_arcade_core.scenes.systems.builtins.spawn.WaveProgressionBinding[source]

Bases: Generic[TCtx]

Declarative wave/lap/round progression rule.

is_complete: Callable[[TCtx], bool]
can_progress: Callable[[TCtx], bool]
advance: Callable[[TCtx], None] | None = None
spawn_next: Callable[[TCtx], SpawnResult] | None = None
on_spawned: Callable[[TCtx, tuple[mini_arcade_core.engine.entities.BaseEntity, Ellipsis]], None] | None = None
insert_into_world: bool = True
class mini_arcade_core.scenes.systems.builtins.spawn.WaveProgressionSystem[source]

Bases: Generic[TCtx]

Advance wave state and optionally spawn the next batch when complete.

name: str = 'common_wave_progression'
phase: int
order: int = 80
enabled_when: Callable[[TCtx], bool]
bindings: tuple[WaveProgressionBinding[TCtx], Ellipsis] = ()
step(ctx: TCtx) None[source]

For each binding, if can_progress and is_complete are both true, call advance and spawn_next (if provided).

Parameters:

ctx (TCtx) – The context object passed to the system, typically containing references to the world, scene, and other relevant state.