mini_arcade_core.engine.components ================================== .. py:module:: mini_arcade_core.engine.components .. autoapi-nested-parse:: Engine components for mini-arcade-core. Classes ------- .. autoapisummary:: mini_arcade_core.engine.components.Sprite2D mini_arcade_core.engine.components.Anim2D mini_arcade_core.engine.components.Life Module Contents --------------- .. py:class:: Sprite2D Simple 2D sprite entity. :ivar texture: The texture ID of the sprite. .. py:attribute:: texture :type: int .. py:class:: Anim2D Simple 2D animation entity. :ivar anim: The animation object. :ivar texture: The cached current frame of the animation. .. py:attribute:: anim :type: mini_arcade_core.engine.animation.Animation .. py:attribute:: texture :type: int | None :value: None .. py:method:: step(dt: float) -> None Update the animation and cache the current frame. :param dt: The time delta to step the animation. :type dt: float .. py:class:: Life Life component with optional time-to-live. :ivar ttl: The time-to-live of the entity. If None, the entity is immortal. :ivar alive: Whether the entity is alive or not. .. py:attribute:: ttl :type: float | None :value: None .. py:attribute:: alive :type: bool :value: True .. py:method:: step(dt: float) -> None Update the life component, reducing ttl and setting alive to False if ttl expires. :param dt: The time delta to step the life component. :type dt: float