decay 0.1.2

Zero-dependency TUI framework for making games
Documentation
# Decay

[![Crates.io](https://img.shields.io/crates/v/decay)](https://crates.io/crates/decay)
[![GitHub Release](https://img.shields.io/github/v/release/oracle58/decay)](https://github.com/oracle58/decay/releases)
[![CI](https://github.com/oracle58/decay/actions/workflows/ci.yml/badge.svg)](https://github.com/oracle58/decay/actions/workflows/ci.yml)

<img width="842" height="318" alt="DECAYBANNER" src="https://github.com/user-attachments/assets/83377546-aee8-40d4-8218-dd81dc38cb2e" />

---
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

```rust
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