Skip to content

TileAnimation

Struct

Source: TileAnimation.h

Description

Single tile animation definition (compile-time constant).

Defines a sequence of tile indices that form an animation loop. All data stored in PROGMEM/flash to minimize RAM usage.

Memory Layout: 4 bytes total (POD structure)

  • baseTileIndex: First tile in animation sequence (0-255)
  • frameCount: Number of frames in animation (1-255)
  • frameDuration: Hold each animation cell for this many 60 Hz ticks (1-255). Logical tick rate is capped at 60/s (wall clock), independent of Engine loop speed.
  • reserved: Padding for alignment (future use)

Example: Water animation with 4 frames, 8 ticks per frame (~133 ms per cell at 60 Hz)

This structure is stored in PROGMEM (flash memory) sizeof(TileAnimation) == 4 bytes

TIP

This structure is stored in PROGMEM (flash memory)

TIP

sizeof(TileAnimation) == 4 bytes

Properties

NameTypeDescription
baseTileIndexuint8_tFirst tile in sequence (e.g., 42)
frameCountuint8_tNumber of frames (e.g., 4)
frameDurationuint8_tTicks per frame (e.g., 8)
reserveduint8_tPadding for alignment/future use

Released under the MIT License.