Expand description
Decay: a zero-dependency ECS TUI game framework.
Build terminal games with an entity-component-system architecture, double-buffered rendering, and direct platform I/O.
use decay::prelude::*;
App::new()
.plugin(CorePlugins)
.system(Phase::Init, |world: &mut World| {
world.spawn((Node::new(4, 2, 20, 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;
}
})
.plugin(UiPlugin)
.run();