decay 0.1.5

Zero-dependency TUI framework for making games
Documentation
  • Coverage
  • 23.43%
    97 out of 414 items documented1 out of 194 items with examples
  • Size
  • Source code size: 205.28 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 25.95 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 26s Average build duration of successful builds.
  • all releases: 31s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • oracle58

Decay

Crates.io


Zero-dependency ecs game framework for the terminal. Entities, components, systems, double-buffered rendering, and direct platform I/O. No crossterm, ratatui or ncurses.

Quickstart

use decay::prelude::*;

fn main() {
    App::new()
        .plugin(CorePlugins)
        .plugin(UiPlugin)
        .system(Phase::Init, |world: &mut World| {
            world.spawn((Node::new(4, 2, 30, 1), Text::new("Hello, decay!")));
        })
        .system(Phase::Update, |world: &mut World| {
            if world.resource::<Input>().is_some_and(|i| i.just_pressed(KeyCode::Char('q'))) {
                world.resource_mut::<AppExit>().unwrap().0 = true;
            }
        })
        .run();
}

Overview

Module Functions
core ECS world, entities, components, queries (&T, &mut T, filters), resources, system scheduling with 7 phases, command buffer, events, hierarchy, change detection, state machine
ui Retained-mode UI on top of ECS: nodes, text, buttons, focus/keyboard nav, z-index, layout, text input, scroll/list views, progress bars, theming
term Double-buffered framebuffer with cell-level diffing. Direct Win32/Unix syscalls. Bold, dim, italic, underline, strikethrough. Mouse input. 24-bit color.
anim Tweens, keyframe tracks, easing functions
time Timer component, DeltaTime resource
rand Seedable xorshift64: range, pick, shuffle, chance
grid Grid<T>, A* pathfinding, flood fill, Bresenham lines, shadowcasting FOV
procgen Value noise, BSP room generation, drunkard's walk caves
serde Minimal binary serialize/deserialize for save files. No serde dependency.
audio waveOutWrite (Windows), ALSA via dlopen (Linux). Tone and noise generators.
net TCP client/server, binary wire protocol, lock-free SPSC channel

Platform support

Windows and Linux. Direct FFI to kernel32/Win32 console APIs on Windows, raw termios + ioctl on Linux/macOS. No libc wrapper crate needed.

License

Apache-2.0