mini_arcade_core.engine.animation

Animation module for handling frame-based animations in the mini arcade engine.

Attributes

Classes

Animation

Simple animation class that cycles through frames at a specified FPS.

Module Contents

mini_arcade_core.engine.animation.TFrame
class mini_arcade_core.engine.animation.Animation[source]

Bases: Generic[TFrame]

Simple animation class that cycles through frames at a specified FPS.

Variables:
  • (Sequence[TFrame]) (frames) – The frames of the animation.

  • (float) (time) – Frames per second for the animation.

  • (bool) (loop) – Whether the animation should loop.

  • (float) – Internal timer to track frame changes.

  • (int) (index) – Current frame index.

frames: Sequence[TFrame]
fps: float = 10.0
loop: bool = True
time: float = 0.0
index: int = 0
update(dt: float) None[source]

Update the animation based on the elapsed time.

Parameters:

dt (float) – Time elapsed since the last update (in seconds).

property current_frame: TFrame

Get the current frame of the animation.

Returns:

The current frame.

Return type:

TFrame