mini_arcade_core.engine.components

Engine components for mini-arcade-core.

Classes

Sprite2D

Simple 2D sprite entity.

Anim2D

Simple 2D animation entity.

Life

Life component with optional time-to-live.

Module Contents

class mini_arcade_core.engine.components.Sprite2D[source]

Simple 2D sprite entity.

Variables:

texture – The texture ID of the sprite.

texture: int
class mini_arcade_core.engine.components.Anim2D[source]

Simple 2D animation entity.

Variables:
  • anim – The animation object.

  • texture – The cached current frame of the animation.

anim: mini_arcade_core.engine.animation.Animation
texture: int | None = None
step(dt: float) None[source]

Update the animation and cache the current frame.

Parameters:

dt (float) – The time delta to step the animation.

class mini_arcade_core.engine.components.Life[source]

Life component with optional time-to-live.

Variables:
  • ttl – The time-to-live of the entity. If None, the entity is immortal.

  • alive – Whether the entity is alive or not.

ttl: float | None = None
alive: bool = True
step(dt: float) None[source]

Update the life component, reducing ttl and setting alive to False if ttl expires.

Parameters:

dt (float) – The time delta to step the life component.