Expand description
Sprite Animation System — frame-by-frame ASCII art animation.
Provides a SpriteAnimator that drives frame-based animations for entities
in the Chaos RPG. Each animation is a sequence of SpriteFrames, where each
frame is a collection of positioned, colored glyphs forming the ASCII art.
§Architecture
SpriteAnimator
├─ animations: HashMap<String, SpriteAnimation>
├─ current: String (active animation name)
├─ frame_index: usize
├─ frame_timer: f32
└─ state_machine: AnimationStateMachine
├─ states: HashMap<String, AnimState>
├─ transitions: Vec<AnimTransition>
└─ params: HashMap<String, f32>§Pre-built Animations
The module includes ready-to-use animations for:
- Player: idle, attack, cast, hurt, defend
- Enemy: idle, attack, death
- Bosses: unique idle and attack per boss type
Structs§
- Anim
Event - Events emitted by the animator during playback.
- Anim
State - A state in the animation state machine.
- Anim
Transition - A transition between animation states.
- Animation
Library - Pre-built animation library for the Chaos RPG.
- Animation
State Machine - Simple animation state machine.
- Frame
Glyph - A single glyph within a sprite frame, positioned relative to entity center.
- Sprite
Animation - A named animation consisting of ordered frames.
- Sprite
Animator - Drives frame-by-frame sprite animations with an optional state machine.
- Sprite
Frame - A single frame of a sprite animation — the complete ASCII art for one pose.
Enums§
- Anim
Condition - Condition for transitioning between animation states.
- Loop
Mode - How an animation repeats.