No description
Find a file
2026-01-23 12:05:59 -05:00
src forrrrrrr the sun, for the one 2026-01-23 12:05:59 -05:00
.gitignore yess,, 2026-01-09 00:03:33 -05:00
Cargo.lock 0.18.0 2026-01-22 21:30:02 -05:00
Cargo.toml 0.18.0 2026-01-22 21:30:02 -05:00
README.md aa, 2026-01-16 22:57:46 -05:00
ron.toml yess,, 2026-01-09 00:03:33 -05:00
rust-toolchain.toml efwafffffffffff 2026-01-15 21:35:59 -05:00

予言の鳥

a dialogue plugin for bevy

Usage

use bevy::prelude::*;
use yogen_no_tori::prelude::*;

fn main() { 
  App::new()
    .add_plugins(
      DefaultPlugins,
      // add the plugin
      DialoguePlugin
    )
    .add_system(Startup, spawn_dialogue)
    .run();
}

fn spawn_dialogue(mut commands: Commands) {
    // create a new graph
    let dialogue = ActionGraph::build()
      // add action nodes
      .start_with_text("A kitsune is standing in front of you.")
      .followed_by_choice()
      .followed_by_many(|choice| {
        choice.followed_by_text("hi?", "<your wallet is missing>")
          .end();

        choice.followed_by_text("go away you nasty thing", "<your soul is missing>")
          .end();

        choice.followed_by_text("<pat the kitsune>", "aaaa! <33")
          .followed_by_text("The kitsune leaves happily.")
          .followed_by_text("...")
          .followed_by_text("<your wallet is missing>")
          .end();
      });

    // spawn the graph
    dialogue.spawn_dialogue(dialogue);
}