2.0.0 • Published 5 years ago
@akashic-extension/coe v2.0.0
COE
COE (co-experience framework) は Akashic Engine で非対称・軽量なマルチプレイを実現するための拡張ライブラリです。
本ライブラリは主に次の機能を提供します。
- Akashic コンテンツの容易なマルチプレイ化
- コンテンツ内で子コンテンツを実行
利用方法
本フレームワークについては以下の文書を参照してください。
インストール
以下からモジュールをインストールします。
npm i @akashic-extension/coe --save利用
- 任意の script 内でインポートします。
- Akashic のエントリポイントから
initialize()関数を呼び出します。 - 任意の
Controllerのインスタンスを生成します。 coe.Sceneのインスタンスを生成し、Controllerを渡します。
サンプルコード (TypeScript)
import * as coe from "@akashic-extension/coe";
module.exports = (args) => {
coe.initialize({ game: g.game, args });
const scene = new coe.Scene({
// ...
controller: new coe.COEController({
// ...
});
});
scene.onLoad.add(() => {
// ...
});
}設計
本フレームワークは以下のモデルによって作られています。
- Controller
- View からの Action を受け取る。
- View へ Command をブロードキャストする。
- 一つのプレイに対し、必ず一つのみ存在する。
- View
- Controller に対して Action を送信する。
- Controller からブロードキャストされた Command を受信した際の処理を持つ。
- 一つのプレイに対し、複数存在しうる。
- 一つの View は Akashic Engine の各インスタンスに相当する。
また、 Controller/View 間でのデータモデルは以下の2つがあります。
- Action
- View から Controller に対して送信されるデータ。
- Command
- Controller からブロードキャストされるデータ。
Action
Action +------------+ (trusted) +--------+
+----------> | Controller | <---------- | system |
| +------------+ +--------+
| |
| +-------------+ Command
| | | (broadcast)
| v v
+--------+ +--------+
| View | | View |
+--------+ +--------+ビルド
npm run buildテスト
npm testテスト前に成果物の pack を無視する場合
npm run test-skip-installライセンス
本リポジトリは MIT License の元で公開されています。 詳しくは LICENSE をご覧ください。
ただし、画像ファイルおよび音声ファイルは CC BY 2.1 JP の元で公開されています。
2.3.0
2 years ago
2.2.2
2 years ago
2.2.1
3 years ago
2.2.0
3 years ago
2.1.0
4 years ago
2.0.0
5 years ago
2.0.0-beta.3
5 years ago
1.3.0
5 years ago
2.0.0-beta.2
5 years ago
2.0.0-beta.1
5 years ago
1.2.0
6 years ago
2.0.0-beta.0
6 years ago
1.1.3
6 years ago
1.1.2
6 years ago
1.1.1
6 years ago
1.1.0
6 years ago
1.0.0
7 years ago