mini_arcade_core.scenes.systems.builtins.projectiles

Reusable projectile lifecycle systems.

Classes

ProjectileBoundaryBinding

Culling rule for projectile-like entities.

ProjectileBoundarySystem

Cull projectile-like entities against the current viewport.

ProjectileCleanupBinding

Cleanup rule for projectile-like entities.

ProjectileCleanupSystem

Remove dead projectile-like entities and optionally compact tracked ids.

ProjectileLifecycleBinding

Full projectile lifecycle configuration for motion, culling, and cleanup.

ProjectileLifecycleBundle

Compose motion, boundary, and cleanup for projectile-like entities.

Module Contents

class mini_arcade_core.scenes.systems.builtins.projectiles.ProjectileBoundaryBinding[source]

Bases: Generic[TCtx]

Culling rule for projectile-like entities.

entities_getter: Callable[[TCtx], Iterable[mini_arcade_core.engine.entities.BaseEntity]]
predicate: Callable[[TCtx, mini_arcade_core.engine.entities.BaseEntity], bool]
margin: float = 0.0
margin_getter: Callable[[TCtx, mini_arcade_core.engine.entities.BaseEntity], float]
on_cull: Callable[[TCtx, mini_arcade_core.engine.entities.BaseEntity], None]
class mini_arcade_core.scenes.systems.builtins.projectiles.ProjectileBoundarySystem[source]

Bases: Generic[TCtx]

Cull projectile-like entities against the current viewport.

name: str = 'common_projectile_boundary'
phase: int
order: int = 36
enabled_when: Callable[[TCtx], bool]
bindings: tuple[ProjectileBoundaryBinding[TCtx], Ellipsis] = ()
__post_init__() None[source]
step(ctx: TCtx) None[source]

For each binding, cull entities that don’t satisfy the predicate and are outside the viewport plus margin.

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.projectiles.ProjectileCleanupBinding[source]

Bases: Generic[TCtx]

Cleanup rule for projectile-like entities.

entities_getter: Callable[[TCtx], Iterable[mini_arcade_core.engine.entities.BaseEntity]]
keep_entity: Callable[[mini_arcade_core.engine.entities.BaseEntity], bool]
tracked_ids_attr: str | None = None
tracked_domain_name: str | None = None
class mini_arcade_core.scenes.systems.builtins.projectiles.ProjectileCleanupSystem[source]

Bases: Generic[TCtx]

Remove dead projectile-like entities and optionally compact tracked ids.

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

For each binding, remove entities that don’t satisfy keep_entity, and if tracked_ids_attr and tracked_domain_name are provided, compact the tracked ids for the remaining entities.

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.projectiles.ProjectileLifecycleBinding[source]

Bases: Generic[TCtx]

Full projectile lifecycle configuration for motion, culling, and cleanup.

entities_getter: Callable[[TCtx], Iterable[mini_arcade_core.engine.entities.BaseEntity]]
predicate: Callable[[TCtx, mini_arcade_core.engine.entities.BaseEntity], bool]
dt_getter: Callable[[TCtx, mini_arcade_core.engine.entities.BaseEntity], float]
drag: float | None = None
drag_getter: Callable[[TCtx, mini_arcade_core.engine.entities.BaseEntity], float | None] | None = None
spin_attr: str | None = None
ttl_step: bool = False
margin: float = 0.0
margin_getter: Callable[[TCtx, mini_arcade_core.engine.entities.BaseEntity], float]
on_cull: Callable[[TCtx, mini_arcade_core.engine.entities.BaseEntity], None]
keep_entity: Callable[[mini_arcade_core.engine.entities.BaseEntity], bool]
tracked_ids_attr: str | None = None
tracked_domain_name: str | None = None
class mini_arcade_core.scenes.systems.builtins.projectiles.ProjectileLifecycleBundle[source]

Bases: mini_arcade_core.scenes.systems.SystemBundle[TCtx]

Compose motion, boundary, and cleanup for projectile-like entities.

bindings: tuple[ProjectileLifecycleBinding[TCtx], Ellipsis] = ()
enabled_when: Callable[[TCtx], bool]
motion_name: str = 'common_projectile_motion'
motion_phase: int
motion_order: int = 30
boundary_name: str = 'common_projectile_boundary'
boundary_phase: int
boundary_order: int = 36
cleanup_name: str = 'common_projectile_cleanup'
cleanup_phase: int
cleanup_order: int = 46
include_motion: bool = True
include_boundary: bool = True
include_cleanup: bool = True
__post_init__() None[source]
iter_systems() Iterable[object][source]

Return the concrete systems that should be added to the pipeline.