npm.io
0.1.3 • Published 6 years ago

kibounohana

Licence
AGPL-3.0
Version
0.1.3
Deps
0
Size
47 kB
Vulns
0
Weekly
0
Stars
1

Kibounohana (希望の花)

Introduction

Web-based AVG engine.

Usage

Include Kibounohana JS File
yarn add kibounohana
<script src="./node_modules/kibounohana/index.js"></script>
Write Your Story

See neruthes/kibounohana-demo for demo and here is the online demo.

Sample story:

const myGame = {};
myGame.scenes = {
    s0: {
        type: 'basic',
        dialogue: [
            { char: 'Alice', bg: '1.png', text: 'Hey, Bob!' },
            { char: 'Bob', bg: '2.png', text: 'How are you, Alice!' }
        ],
        choices: [
            { label: 'Start Over', jump: 's0' }
        ]
    }
};
Boot The game
kibounohana.Initd.boot(myGame, '#displayTarget');

This method accept 2 arguments:

Argument Description
arg1 Game story object.
arg2 CSS selector string for the display target.
Notice These As Well
  • Set kibounohana.config.deploymentTarget to un string like http://localhost:8000.
  • Background images for dialogues should be placed in /assets/img/.
  • You can define your own scene types (eg mySceneType) by setting kibounohana.View.renderMainView_mySceneType as un function which accept currentSceneObj as arguments[0].

Copyright (c) 2020 Neruthes.

Published under GNU AGPL v3.