ブラウザゲーム
言語・国・通貨: JA · 価格

この端末のCookieに保存されます。他の通貨での価格は概算です。各出品には出品者の元の価格も表示されます。為替レートはExchange Rate API提供、毎日更新。

ブラウザゲーム

Sofala向けのブラウザゲームを作る

Players start your game right on play.sofala.market, with nothing to install: free games at once, paid ones after one payment. The easy way is to let an AI agent build and upload it; doing it by hand comes after.

AI エージェントと一緒に

You do not need to know how to program. A coding agent writes the game with you, uploads it to Sofala, writes the listing and publishes it when you say it’s done. Any agent that works with MCP servers can do this; these steps use Claude Code on Windows, and we recommend it with the model Opus 5.5 or newer.

  1. Get a Claude accountGo to claude.ai, create an account and choose a paid plan (Pro or higher). Claude Code is not part of the free plan.
  2. Open PowerShellPowerShell is a window where you type commands. Press the Windows key, type powershell and press Enter. A window opens with a line that starts with PS C:\Users\ and your name. That is where the next lines go.
  3. Install Claude CodeCopy this line, paste it into PowerShell (right-click pastes) and press Enter. Nothing seems to happen while it downloads; wait until it says it is done.
    irm https://claude.ai/install.ps1 | iex
    Now close PowerShell and open it again. This matters: the window you installed from does not know the new program yet.
  4. Check that it worksIn the new PowerShell window, this prints a version number:
    claude --version
    Does it say that claude is not recognized? Then Windows has not been told where Claude Code is. Paste these two lines, one after the other, close PowerShell, open it again and try once more:
    $currentPath = [Environment]::GetEnvironmentVariable('PATH', 'User')
    [Environment]::SetEnvironmentVariable('PATH', "$currentPath;$env:USERPROFILE\.local\bin", 'User')
    Still stuck? Claude Code’s page for installation problems lists the other causes.
  5. Add Sofala, before you start Claude CodeThis tells Claude Code where Sofala is, so it can upload and publish for you. Paste it and press Enter:
    claude mcp add --transport http Sofala https://sofala.market/mcp
  6. Start Claude CodeType this and press Enter:
    claude
    The first time, your browser opens and asks you to sign in with your Claude account. Do that and come back to the PowerShell window.
    Does it stop to ask permission too often? Start it with this line instead, with no checks at all. It then does everything without asking, also when it gets something wrong, so use it only if you accept that; Anthropic advises it only on a computer with nothing on it that you would miss.
    claude --dangerously-skip-permissions
  7. Connect it to your Sofala accountInside Claude Code, type the line below and press Enter, pick Sofala and choose to sign in. Your browser opens sofala.market: type your email address, then the code Sofala emails you. That also makes your Sofala account if you have none; it is free and has no password. Then press Allow. Back in Claude Code, Sofala now shows as connected.
    /mcp
  8. Pick the modelType the line below, press Enter and choose Opus 5.5 or newer. A game is a lot of code, and smaller models make more mistakes.
    /model
  9. Ask for your gameNow say what you want, in your own words and in any language. For example:
    Make a simple online multiplayer snake game that runs in the browser, for Sofala. Use Sofala’s multiplayer rooms so friends can join. Let me test it, and when I say it’s done, put it on Sofala as a free game.
  • When the game is ready to try, your agent gives you a link to play it on Sofala before anyone else can see it. Say what to change, as often as you like: “make the snakes faster”, “add a score board”.
  • Happy with it? Say “publish it”. A person at Sofala plays each new game before it goes up; you get an email when it is live.
  • To change a live game later, open PowerShell, start Claude Code again and ask. The new build replaces the old one at the same address.
  • On a Mac or on Linux, open Terminal instead of PowerShell and install with the line on Claude Code’s setup page; the other steps are the same. Using another agent? Add a remote MCP server with the address https://sofala.market/mcp.

For manual game devs

Building or packaging the game yourself? This is what Sofala expects. An AI agent follows the same rules; it reads them from Sofala.

ZIP

  • index.htmlがゲームを起動します。ZIPの最上位か、ZIP内の唯一のフォルダに置いてください。
  • ゲームが読み込むものはすべてZIPに入れ、相対パスでリンクします:Build/game.wasmであり、/Build/game.wasmや自分のサイトの完全なアドレスは使いません。
  • 圧縮時1 GBまで、10 000ファイル、展開後2 GBまで。

エンジンとファイル形式

  • ブラウザで動くゲームなら何でも動きます:HTML5 canvas、WebGLとWebGPU(three.js、Babylon.js、PixiJS、Phaser、PlayCanvas)、WebAssembly(Emscripten、Rust、Bevy、Go)、Godot 3と4、GameMaker、Construct、Defold、PICO-8、RPG Maker、love.js経由のLÖVE。
  • Unity WebGL:どの圧縮方式でも動きます。BrotliとgzipのファイルはヘッダーとともにSofalaが正しく配信するので、decompression fallbackは不要です。
  • JavaScriptモジュール、import map、.mjsファイル、glTFとGLBのモデル、KTX2テクスチャ、WAV・OGG・Opus・MP3の音声は、すべて正しい種類で配信されます。

マルチスレッドのゲーム

  • スレッド(SharedArrayBuffer)を使うビルド、たとえばスレッドを有効にしたGodot 4、-pthread付きのEmscripten、スレッド対応のUnityやlove.jsのビルドは、クロスオリジン分離されたページが必要です。SofalaはZIPのアップロード時にそれを検出し、その方式で実行します。Brotliだけで圧縮したUnityビルドの場合は、出品の「SharedArrayBufferが必要」にチェックを入れてください。
  • 分離されたゲームは、CORSまたはCross-Origin-Resource-Policyヘッダーを送らない他サイトからスクリプト、画像、音声を読み込めません。すべてZIPに入れてください。スレッドを使わないゲームは他サイトから読み込めます。

ゲームの中

  • localStorageやIndexedDBのセーブデータは、プレイヤーのブラウザにゲームごとに別々に残ります。
  • ゲームは全画面、マウスポインター、ゲームパッド、音声、WebXRを使えます。Sofalaのページにも全画面ボタンがあります。
  • ゲームは専用のアドレスで、サンドボックス化されたフレームの中で動きます。ポップアップを開いたり、ページを離れたり、プレイヤーのSofalaアカウントを見たりはできません。ゲーム内でログインや支払いを求めないでください。販売するのはSofalaです。
  • マルチプレイに自前のサーバーは要りません。Sofala がルームを運営します(下記参照)。自分のサーバーと通信するゲームも作れます。

スマホ・タブレット

  • タッチは window や document ではなく、canvas などゲームの要素で受け取ってください。フレーム内の iPhone はタッチを window に渡さないことがあります。
  • その要素に CSS の touch-action: none を指定し、{ passive: false } で追加した touchstart と touchmove のリスナーで preventDefault() を呼んでください。そうしないと、スマホはスワイプをページのスクロールと判断し、数ピクセルでゲームへの通知をやめてしまいます。
  • スマホでもポインターイベント(pointerdown、pointermove)は届きます。1 本の指を 1 回と数えるなら、両方を受け取っても構いません。
  • Snake Party はこれをすべて行っていて、iPhone でもスワイプが効きます。やり方はソースコードでわかります。
  • ゲームエンジンで作ったゲームなら、タッチ入力はエンジン側の担当です。何で作ったゲームでも、公開前にスマホで試してください。
const area = document.querySelector('canvas');   // an element of the game, not window
area.style.touchAction = 'none';
let from = null;
area.addEventListener('touchstart', e => {
  e.preventDefault();
  from = [e.touches[0].clientX, e.touches[0].clientY];
}, { passive: false });
area.addEventListener('touchmove', e => {
  e.preventDefault();
  if (!from) return;
  const x = e.touches[0].clientX, y = e.touches[0].clientY, dx = x - from[0], dy = y - from[1];
  if (Math.abs(dx) < 20 && Math.abs(dy) < 20) return;
  from = [x, y];
  swipe(Math.abs(dx) > Math.abs(dy) ? (dx > 0 ? 'right' : 'left') : (dy > 0 ? 'down' : 'up'));
}, { passive: false });

マルチプレイ

  • Sofala がルームを運営するので、ゲームにサーバーは要りません。sofala-game-1.1.js を ZIP の index.html の隣に置き、自分のスクリプトより先に読み込めば、1 行でプレイヤーをほかの人と同じルームに入れられます。
  • プレイヤーが送ったものは、送った順にルームのほかのプレイヤーに届きます。1 ルームは最大 32 人で、それぞれ 1 秒に 60 件、1 件 16 KB までのメッセージを送れます。ターン制、パーティー、ゆるいリアルタイムのゲームにちょうどよく、速いシューティングには引き続き専用サーバーが必要です。
  • Sofala はあなたのコードを実行しません。ルームにいちばん長くいるプレイヤーがホストです。ホストにゲームを進めさせ、変化をほかのプレイヤーに伝えさせてください。ホストが抜けると、次のプレイヤーがホストになります。
  • クイックプレイは公開ルームを埋めていきます。プライベートルームには、友だちが参加するためのコードがあります。
  • ゲームは各プレイヤーを、ゲーム内で変わらない ID とプレイヤー名で識別し、メールアドレスやアカウントは使いません。プレイヤー名は、アカウントページで別の名前を選んでいなければ Sofala の名前です。参加時に名前を入力してもらうこともできます。ログインせずに無料ゲームを遊ぶ人はゲストです。
  • 自分のパソコンでも同じように動きます。localhost からゲームを開けば、ルームは自分専用のテスト環境になります。
  • それでも自分のサーバーを使う場合は、Sofala.token() がプレイヤーが誰かを示す署名付きトークンを渡します。https://sofala.market/game-api/keys の公開鍵で検証してください。
<script src="sofala-game-1.1.js"></script>
<script type="module">
  const room = await Sofala.rooms.quick({ max: 4 });   // a room with other players, or a new one

  room.on('message', (data, from) => { /* from.name did something */ });
  room.on('enter', peer => { });
  room.on('exit', peer => { });

  room.send({ move: 'e2e4' });                         // to everyone else in the room
</script>

ルームでできることは、すべて sofala-game-1.1.js の冒頭に書いてあります。お手本になるゲームを丸ごと 1 ファイルで: Snake Party(ソースコード)。

販売する

  • 無料にするか、付加価値税込みで€0.50以上の価格を設定します。あなたには税抜き価格からSofalaの手数料5%とStripeの手数料を引いた額がStripe経由で届きます。先に「販売」ページで入金先を設定してください。
  • 出品の最初のカバー写真が、play.sofala.marketでのゲームのタイルになります。横長16:9のスクリーンショットが最適です。追加のスクリーンショットやプレビュー動画は、出品の編集ページで追加してください。
  • 新しいゲームは公開前に Sofala のスタッフが実際にプレイします。公開されるとメールでお知らせします。
  • 公開中のゲームを更新するには、新しい ZIP をアップロードします(エージェントなら upload_files に replace を付けます)。1 分ほどで古いものと入れ替わり、再審査はなく、アドレスも変わらないので、プレイヤーのセーブデータはそのまま残ります。

ゲームを公開する