Crates.io | brltk |
lib.rs | brltk |
version | 0.0.0 |
source | src |
created_at | 2023-02-15 03:19:54.938152 |
updated_at | 2023-02-15 03:19:54.938152 |
description | A Bevy Rougelike Toolkit |
homepage | |
repository | https://github.com/YendorEngine/bevy_doryen |
max_upload_size | |
id | 785491 |
size | 20,123 |
An opinionated rougelike toolkit for bevy
BRLTK lets you use Bevy with various roguelike libraries. Currently, it supports doryen-rs, bracket-lib, and bevy_ascii_terminal
The main branch is compatible with the latest Bevy release
Compatibility of BRLTK
versions:
BRLTK |
bevy |
---|---|
0.1.0 |
0.9 |
Using doryen-rs
backend:
App::build()
// Add the `BRLTKPlugin` to Bevy.
.add_plugin(BRLTKPlugin::with_backend(DoryenBackend {
// here are all the available options.
// better practice is to use default values (see other examples)
app_options: DoryenAppOptions {
console_width: CONSOLE_WIDTH,
console_height: CONSOLE_HEIGHT,
screen_width: CONSOLE_WIDTH * 8,
screen_height: CONSOLE_HEIGHT * 8,
window_title: String::from("my roguelike"),
font_path: String::from("terminal_8x8.png"),
vsync: true,
fullscreen: false,
show_cursor: true,
resizable: true,
intercept_close_request: false,
max_fps: 60,
},
..Default::default()
}))
// Add your Bevy systems like usual. Excluding startup systems, which
// only run once, these systems are run during Doryen's update phase;
// i.e. 60 times per second.
.add_startup_system(init)
.add_system(input)
// The `RenderSystemExtensions` trait lets you add systems that should
// be run during Doryen's render phase.
.add_doryen_render_system(render)
.run();
Using bracket-lib
backend:
⚠️(Default Plugins are required for the bracket-lib
backend)⚠️
App::build()
.add_plugins(DefaultPlugins)
// Add the `BRLTKPlugin` to Bevy.
.add_plugin(BRLTKPlugin::with_backend(
BracketLibBackend::simple_80x50()
.with_named_color("blue", BLUE)
.with_named_color("pink", Color::PINK),
))
.insert_resource(State {
y: 0,
going_down: true,
})
.add_system(tick)
.run();
Once set up, you can quickly try out the examples by cloning this repo and running the following commands:
# Switch to the correct version (latest release, default is main development branch)
git checkout latest
# Runs the "basic_doryen" example
cargo run --example basic_doryen
or
# Runs the "basic_bracket" example
cargo run --example basic_bracket
Bevy is only possible because of the hard work put into these foundational technologies:
Additionally, I would like to thank the Jice and his library doryen-rs for providing the bones to build this toolkit. This crate uses a modified version of doryen-rs
to provide a more bevy-like interface.
I would also like to thank alexschrod who started this implementation back in bevy 0.5, which allowed me to fork the repository and continue the work.
And as always, a special shoutout to thebracket for his bracket-lib game engine which began my journey into the world of roguelikes. He is my inspiration for this project.
BRLTK is free, open source and permissively licensed! All code in this repository is dual-licensed under either:
This means you can select the license you prefer! This dual-licensing approach is the de-facto standard in the Rust ecosystem and there are very good reasons to include both.
The assets included in this repository (for our examples) typically fall under different open licenses, but most are free for commercial use.
See CREDITS.md for the details of the licenses of those files.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.