class AnimationMessage: Message

Represents an animation to be played.

animation: Animation | fun(dt: number, display: Display): boolean

An animation to be played in a display. Yield an AnimationMessage to play one. Animations can be built with a list of frames and durations, or with a custom function.

actor: Actor?

An optional actor to play the animation relative to.

x: integer?

An x position to play the animation at. If an actor is given, this is relative to their position.

y: integer?

A y position to play the animation at. If an actor is given, this is relative to their position.

blocking: boolean

Whether to block other processes while the animation plays.

skippable: boolean

Whether the animation can be skipped with input.

override: boolean

Whether to override (hide the actor) during animation drawing.

__new(
    self: AnimationMessage,
    options: AnimationMessageOptions
)
class AnimationMessageOptions
animation: Animation | fun(dt: number, display: Display): boolean

An animation to be played in a display. Yield an AnimationMessage to play one. Animations can be built with a list of frames and durations, or with a custom function.

actor: Actor?

Entities in the game, including the player, enemies, and items. Actors are composed of Components that define their state and behavior. For example, an actor may have a Sight component that determines their field of vision, explored tiles, and other related aspects.

x: integer?
y: integer?
blocking: boolean?
skippable: boolean?
override: boolean?