npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@akashic/akashic-sandbox

v0.28.13

Published

Standalone runner for Akashic contents

Downloads

942

Readme

Akashic Sandbox

Akashic Sandboxは、 Akashic Engine を使って作成されたゲームの動作確認ツールです。

インストール

Node.js が必要です。次のコマンドでインストールできます。

npm install -g @akashic/akashic-sandbox

利用方法

akashic-sandbox [-p <port>] [--cascade<cascade-path>] [<path>]

で、 <path> に置かれているAkashicのゲームを起動できます。 出力される案内にしたがって、Webブラウザで http://localhost:3000/game/ を開いてください。

<path> には game.json が存在する必要があります。省略された場合、 <path> はカレントディレクトリ (.) です。 -p オプションを指定すると、サーバのポート番号を変更できます。たとえば -p 3100 とした場合、 Webブラウザで開くURLは http://localhost:3100/game/ になります。

--cascade <cascade-path> を与えると、 path にある game.json に対して <cascade-path> にある game.json がカスケードされます。 --cascade を複数指定した場合、指定した順でカスケードされます。

Akashic Engineの詳細な利用方法については、 公式ページ を参照してください。

Akashic Engine 2.0 を利用したコンテンツの起動方法

game.json に以下の記述を追加すると、対象のゲームを Akashic Engine 2.0 として実行します。

{
..
	"environment": {
		"sandbox-runtime": "2"
	}
}

表示オプション

  • http://localhost:3000/game/?profiler=1 にアクセスすると、プロファイラー表示モードでゲームを実行することができます
  • http://localhost:3000/game/?fit=1 にアクセスすると、画面を最大まで拡大した状態でゲームを実行することができます
  • http://localhost:3000/game/?bg=1 にアクセスすると、バックグラウンドとゲームに色をつけた状態でゲームを実行することができます

デベロッパーメニュー

  • ゲーム画面右上の歯車マークをクリックするとデベロッパーメニューが開きます。
  • http://localhost:3000/game/?devmode=disable にアクセスするとデベロッパーメニューを無効化できます。

設定ファイルの利用

コンテンツの game.json と同じディレクトリに sandbox.config.js を置いた場合、実行時の挙動をカスタマイズできます。

var config = {
	/** ゲーム実行時にeventsの同名メンバーをイベントとして送信します */
	autoSendEventName: "event0",
	/** ゲーム実行時にデベロッパーメニューを開きます */
	showMenu: true,
	/** デベロッパーメニューに登録済みのイベントとして表示します */
	events: {
		event0: [32, null, "9999", {foo: "foo"}, false],
		event1: [32, null, "9999", {var: "var"}, false]
	}
}
module.exports = config;

ビルド方法

akashic-sandbox はTypeScriptで書かれたJSモジュールであるため、ビルドにはNode.jsが必要です。

npm run build にてビルドできます。

npm install
npm run build # src/以下をビルド

内部モジュールの動作確認方法

akashic-sandbox を用いて内部モジュール (とくに engine-files) の動作確認を行いたい場合、以下の手順を行ってください。

  • package.json で engine-files のエイリアスの engine-files-v* に対象のバージョンを指定し npm install します。インストール後に npm run copy:engine-files を実行することで engine-files が ./js/vX/ へ一括コピーされ動作確認が行える状態となります。

環境変数

| 環境変数 | 説明 | 注釈 | |--------|-----|-----| | ENGINE_FILES_V3_PATH | engine-files v3 のビルド成果物のパス。 (e.g. ./engineFilesV3_x_y.js) この値が指定された場合、 対象の engine-files を akashic-engine v3 コンテンツ実行時に利用します。 | エンジン開発用のオプションです。通常、ゲーム開発時に利用する必要はありません。 |

テスト方法

  1. TSLintを使ったLint
  2. Jasmineを使ったユニットテスト

が実行されます。

npm test

ライセンス

本リポジトリは MIT License の元で公開されています。 詳しくは LICENSE をご覧ください。

ただし、画像ファイルおよび音声ファイルは CC BY 2.1 JP の元で公開されています。