Ein Browserspiel für Sofala machen
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.
Mit deinem KI-Agenten
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.
- 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.
- Open PowerShellPowerShell is a window where you type commands. Press the Windows key, type
powershelland press Enter. A window opens with a line that starts withPS C:\Users\and your name. That is where the next lines go. - 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. - Check that it worksIn the new PowerShell window, this prints a version number:
claude --version
Does it say thatclaudeis 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. - 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
- 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
- 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
- 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
- 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.
Das ZIP
- Die index.html startet das Spiel. Leg sie ganz oben ins ZIP oder in seinen einzigen Ordner.
- Alles, was das Spiel lädt, liegt im ZIP und ist über relative Pfade verlinkt: Build/game.wasm, nie /Build/game.wasm oder eine vollständige Adresse deiner eigenen Website.
- Bis 1 GB gepackt, 10 000 Dateien und 2 GB entpackt.
Engines und Dateitypen
- Jedes Spiel, das im Browser läuft, funktioniert: HTML5 Canvas, WebGL und WebGPU (three.js, Babylon.js, PixiJS, Phaser, PlayCanvas), WebAssembly (Emscripten, Rust, Bevy, Go), Godot 3 und 4, GameMaker, Construct, Defold, PICO-8, RPG Maker und LÖVE über love.js.
- Unity WebGL: Jede Komprimierung funktioniert. Brotli- und gzip-Dateien werden mit den richtigen Headern ausgeliefert, du brauchst also kein Decompression Fallback.
- JavaScript-Module, Import Maps, .mjs-Dateien, glTF- und GLB-Modelle, KTX2-Texturen sowie WAV-, OGG-, Opus- und MP3-Sound werden alle mit dem richtigen Typ ausgeliefert.
Spiele mit mehreren Threads
- Builds mit Threads (SharedArrayBuffer), etwa Godot 4 mit Threads, Emscripten mit -pthread und Unity- oder love.js-Builds mit Threads, brauchen eine Cross-Origin-isolierte Seite. Sofala erkennt sie beim Hochladen des ZIP und startet sie so. Bei einem Unity-Build, der nur mit Brotli komprimiert ist, setz den Haken bei „Braucht SharedArrayBuffer“ in der Anzeige.
- Ein isoliertes Spiel kann keine Skripte, Bilder oder Sounds von anderen Websites laden, außer diese senden CORS- oder Cross-Origin-Resource-Policy-Header; pack also alles ins ZIP. Spiele ohne Threads dürfen von anderen Websites laden.
Im Spiel
- Spielstände in localStorage oder IndexedDB bleiben im Browser des Spielers, für jedes Spiel getrennt.
- Das Spiel darf Vollbild, den Mauszeiger, Gamepads, Ton und WebXR nutzen. Sofalas Seite hat auch eine Vollbild-Taste.
- Es läuft in einem abgeschotteten Rahmen unter einer eigenen Adresse: Es kann keine Pop-ups öffnen, die Seite nicht verlassen und das Sofala-Konto des Spielers nicht sehen. Lass Spieler im Spiel nicht anmelden oder bezahlen; Sofala verkauft es.
- Für Mehrspieler brauchst du keinen eigenen Server: Sofala betreibt die Räume (siehe unten). Ein Spiel darf auch mit einem eigenen Server sprechen.
Handys und Tablets
- Hör auf Berührungen an einem Element deines Spiels, etwa seinem Canvas, nicht an window oder document: Im Frame gibt ein iPhone Berührungen nicht immer an window weiter.
- Gib diesem Element das CSS touch-action: none und ruf preventDefault() in seinen touchstart- und touchmove-Listenern auf, hinzugefügt mit { passive: false }. Sonst hält das Handy ein Wischen für Scrollen der Seite und meldet es deinem Spiel nach ein paar Pixeln nicht mehr.
- Pointer-Events (pointerdown, pointermove) kommen auf Handys auch an. Ein Spiel darf auf beide Arten hören, solange ein Finger nur einmal zählt.
- Snake Party macht all das, und seine Wischgesten funktionieren auf einem iPhone; sein Quellcode zeigt, wie.
- Wenn eine Engine dein Spiel gemacht hat, ist die Touch-Eingabe Sache der Engine. Womit auch immer es gemacht ist: Probier das Spiel auf einem Handy aus, bevor du es veröffentlichst.
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 });Mehrspieler
- Sofala betreibt die Räume, also braucht dein Spiel keinen Server. Leg sofala-game-1.1.js in dein ZIP neben die index.html, lade es vor deinem eigenen Skript, und eine Zeile bringt den Spieler mit anderen in einen Raum.
- Was ein Spieler sendet, erreicht die anderen im Raum, in der Reihenfolge, in der es gesendet wurde. Ein Raum fasst bis zu 32 Spieler, und jeder kann 60 Nachrichten pro Sekunde mit bis zu 16 KB senden: richtig für rundenbasierte, Party- und lockere Echtzeitspiele. Ein schneller Shooter braucht weiterhin einen eigenen Server.
- Sofala führt keinen deiner Codes aus. Der Spieler, der am längsten im Raum ist, ist der Host: Lass ihn das Spiel führen und den anderen sagen, was sich geändert hat. Wenn der Host geht, wird der nächste Spieler Host.
- Schnelles Spiel füllt öffentliche Räume. Ein privater Raum hat einen Code, mit dem Freunde beitreten.
- Das Spiel kennt jeden Spieler an einer ID, die in deinem Spiel gleich bleibt, und an seinem Spielernamen, nie an einer E-Mail-Adresse oder einem Konto. Der Spielername ist sein Sofala-Name, außer er hat auf seiner Kontoseite einen anderen gewählt; dein Spiel kann ihn auch beim Beitreten einen eingeben lassen. Wer ein kostenloses Spiel ohne Anmeldung spielt, ist Gast.
- Auf deinem eigenen Computer funktioniert es genauso: Öffne das Spiel über localhost, und die Räume sind ein eigener Testbereich.
- Wenn du doch einen Server betreibst, gibt ihm Sofala.token() ein signiertes Token, das sagt, wer der Spieler ist. Prüfe es mit den öffentlichen Schlüsseln unter
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>Alles, was die Räume können, steht oben in sofala-game-1.1.js. Ein ganzes Spiel zum Abschauen, in einer Datei: Snake Party (sein Quellcode).
Verkaufen
- Kostenlos oder mit Preis inklusive Mehrwertsteuer, mindestens 0,50 €. Du bekommst den Preis ohne Mehrwertsteuer, abzüglich Sofalas Gebühr von 5 % und der Stripe-Gebühr, über Stripe: Richte vorher die Auszahlungen auf deiner Verkaufsseite ein.
- Das erste Coverfoto der Anzeige ist die Kachel des Spiels auf play.sofala.market; ein breiter Screenshot im Format 16:9 wirkt am besten. Weitere Screenshots und ein Vorschauvideo fügst du auf der Bearbeitungsseite der Anzeige hinzu.
- Ein Mensch bei Sofala spielt jedes neue Spiel, bevor es online geht; du bekommst eine E-Mail, wenn es live ist.
- Um ein Spiel zu aktualisieren, das schon live ist, lade das neue ZIP hoch (dein Agent: upload_files mit replace). Es ersetzt das alte in etwa einer Minute, ohne neue Prüfung und unter derselben Adresse, sodass die Spieler ihre Spielstände behalten.