amethyst / amethyst/bracket-lib

Issues using terminal with another game loop

オープン
#160 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Rust
スター
1.7k
フォーク
126
PR マージ指標
30日以内にマージされた PR はありません

説明

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.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。