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.
- 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.
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 फ़ाइलें सही हेडर के साथ भेजी जाती हैं, इसलिए decompression fallback की ज़रूरत नहीं।
- JavaScript मॉड्यूल, import map, .mjs फ़ाइलें, glTF और GLB मॉडल, KTX2 टेक्सचर और WAV, OGG, Opus और MP3 आवाज़ सही प्रकार के साथ भेजे जाते हैं।
मल्टीथ्रेडेड गेम
- थ्रेड (SharedArrayBuffer) इस्तेमाल करने वाले बिल्ड, जैसे थ्रेड चालू वाला Godot 4, -pthread वाला Emscripten और थ्रेड वाले Unity या love.js बिल्ड, को क्रॉस-ओरिजिन आइसोलेटेड पेज चाहिए। ZIP अपलोड करते समय Sofala इन्हें पहचानकर इसी तरह चलाता है। सिर्फ़ Brotli से कंप्रेस किए Unity बिल्ड के लिए लिस्टिंग में “SharedArrayBuffer चाहिए” पर टिक करें।
- आइसोलेटेड गेम दूसरी साइटों से स्क्रिप्ट, तस्वीरें या आवाज़ें तब तक लोड नहीं कर सकता जब तक वे CORS या Cross-Origin-Resource-Policy हेडर न भेजें, इसलिए सब कुछ ZIP में रखें। बिना थ्रेड वाले गेम दूसरी साइटों से लोड कर सकते हैं।
गेम के अंदर
- localStorage या IndexedDB में सेव खिलाड़ी के ब्राउज़र में रहते हैं, हर गेम के लिए अलग।
- गेम फ़ुल स्क्रीन, माउस पॉइंटर, गेमपैड, आवाज़ और WebXR इस्तेमाल कर सकता है। Sofala के पेज पर भी फ़ुल स्क्रीन बटन है।
- यह अपने पते पर एक आइसोलेटेड फ़्रेम में चलता है: यह पॉप-अप नहीं खोल सकता, पेज नहीं छोड़ सकता और खिलाड़ी का Sofala खाता नहीं देख सकता। खिलाड़ियों से गेम के अंदर साइन इन या भुगतान न करवाएँ; इसे Sofala बेचता है।
- मल्टीप्लेयर के लिए अपना सर्वर नहीं चाहिए: Sofala रूम चलाता है (नीचे देखें)। गेम आपके अपने सर्वर से भी बात कर सकता है।
फ़ोन और टैबलेट
- टच को गेम के किसी एलिमेंट पर सुनें, जैसे उसका canvas, window या document पर नहीं: फ़्रेम के अंदर iPhone हमेशा टच को window तक नहीं पहुँचाता।
- उस एलिमेंट को CSS touch-action: none दें, और { passive: false } के साथ जोड़े गए उसके touchstart और touchmove लिसनर में preventDefault() कॉल करें। वरना फ़ोन स्वाइप को पेज स्क्रॉल समझता है और कुछ पिक्सल के बाद आपके गेम को बताना बंद कर देता है।
- फ़ोन पर पॉइंटर इवेंट (pointerdown, pointermove) भी आते हैं। गेम दोनों तरह के इवेंट सुन सकता है, बस एक उंगली एक बार गिनी जाए।
- 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 के बगल में रखें, अपनी स्क्रिप्ट से पहले लोड करें, और एक लाइन प्लेयर को दूसरों के साथ रूम में डाल देती है।
- एक प्लेयर जो भेजता है, वह रूम के बाकी लोगों तक उसी क्रम में पहुँचता है जिसमें भेजा गया। एक रूम में ज़्यादा से ज़्यादा 32 प्लेयर होते हैं, और हर कोई हर सेकंड 60 संदेश भेज सकता है, हर एक 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 के शुरू में लिखा है। सीखने के लिए एक पूरा गेम, एक ही फ़ाइल में: Snake Party (उसका सोर्स कोड)।
बेचना
- इसे मुफ़्त रखें, या VAT सहित कम से कम €0.50 का दाम रखें। आपको VAT के बिना दाम मिलता है, Sofala की 5% फ़ीस और Stripe की फ़ीस घटाकर, Stripe के ज़रिए: पहले अपने Sales पेज पर भुगतान सेट करें।
- लिस्टिंग की पहली कवर फ़ोटो play.sofala.market पर गेम की टाइल बनती है; चौड़ा 16:9 स्क्रीनशॉट सबसे अच्छा रहता है। लिस्टिंग के एडिट पेज पर और स्क्रीनशॉट और एक प्रीव्यू वीडियो जोड़ें।
- Sofala का एक व्यक्ति हर नया गेम ऑनलाइन होने से पहले खेलता है; लाइव होने पर आपको ईमेल मिलता है।
- लाइव गेम अपडेट करने के लिए नया ZIP अपलोड करें (आपका एजेंट: replace के साथ upload_files)। यह लगभग एक मिनट में पुराने की जगह ले लेता है, बिना नई जाँच के और उसी पते पर, इसलिए प्लेयर की सेव बनी रहती हैं।