amethyst / amethyst/bracket-lib

Issues using terminal with another game loop

Open
#160 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
1.7k
Forks
126
PR merge metrics
No merged PRs in 30d

Description

First, thanks for this library! I've enjoyed reading your RLTK tutorial, and while I've built other games, it has inspired me to dip a toe into roguelike development.

I'm trying to use Bracket with [Bevy](https://bevyengine.org). My first goal is to use either curses or crossterm, then scale up from there. So I don't want to use Bracket's game loop, but want to integrate it with Bevy, and wrap whatever terminal logic it needs in Bevy systems.

I've currently got this code, and it behaves differently in different scenarios. The code:

```
// use bevy::prelude::*;
use bracket_lib::prelude::*;

// fn render_system(mut terminal: ResMut) {
// terminal.print(1, 1, "Hello, world.");
// }

fn main() -> BError {
let mut terminal = BTermBuilder::simple(80, 25)?.build()?;
terminal.cls();
terminal.print(5, 5, "Hello, world.\n");
// App::build()
// .add_plugin(bevy::app::ScheduleRunnerPlugin::default())
// .add_resource(terminal)
// .add_system(render_system.system())
// .run();
Ok(())
}
```

* Windows and WSL2 with curses feature: Clears the screen, prints nothing.
* Windows and WSL2 with crossterm feature: Does nothing.

Am I doing something wrong? Your tutorials run the ECS loop inside Bracket's. Given that I'm inverting the pattern, do I need to add some sort of terminal update loop? I see `BTerm::main_loop`, but I'm not sure if this is meant to wrap my game loop, or if it contains logic I need to call to update the terminal itself.

Thanks again.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.