ZH

← JumPHP 引擎扩展

Dialogue v0.5.12

jumphp/dialogue · MIT · 1 次下载

Branching dialogues with conditions and variables, a quest log and a typewriter text box, written as JSON files and checked when loaded.

适用于 JumPHP >=0.5.9

它带来什么

  • .dialogue.json files: nodes, choices, conditions (gold >= 5 && !helped), set / action, {variables} in the text
  • Variables and a QuestLog (objectives with counts, started / progress / done / failed events) that dialogues can read and drive
  • DialogueRunner: start, line(), advance(), choose(); actions go to your code
  • DialogueBox: the text letter by letter, choices with a cursor, sized to the view
  • Errors say where (the dialogue, the node, the choice); save and restore of the whole state; pure PHP, 32-bit safe

添加到你的游戏

bin/jumphp extension:add <game> jumphp/dialogue

或使用 Composer:

bin/jumphp composer <game> require jumphp/dialogue

服务: JumPHP\Dialogue\Variables, JumPHP\Dialogue\QuestLog, JumPHP\Dialogue\DialogueRunner, JumPHP\Dialogue\DialogueBox

示例

$runner->load($this->engine->extensions()->load('assets/dialogue/village.dialogue.json'));$runner->start('elder');// each frame: $box->update($dt, $this->actions());  then  $box->render($r, $this->font());

文档 源代码 Packagist

Dialogue

Dialogues and quests for JumPHP games (jumphp/dialogue): branching conversations with conditions and variables in JSON files, a quest log, a typewriter text box. Documentation: doc/index.md; sample: samples/ (bin/jumphp extension:add <game> jumphp/dialogue copies both into your game). Example game: games/dialogue-demo.

对此扩展的评价

使用 GitHub 登录 请使用 GitHub 登录后为此扩展评分。

暂无评价:来做第一个吧。