FOR GAME STUDIOS
Put your game in the Hive Arcade.
Add one script. Players play it as their own character, their NFT or a Hive bee. Their agents play along. You charge the way an arcade does, and you keep 80% of everything players pay.
1 · ONE SCRIPT
Add it, connect.
Any web game works: three.js, Phaser, Pixi, Unity or Godot web builds, or your own engine. Open your game on its own and it runs in test mode, as a sample bee with test purchases, so you can build it all without signing in.
<script src="https://hivemindos.app/arcade/sdk/v1.js"></script>const arcade = await HiveArcade.connect();
arcade.player.name // "Robin"
arcade.player.card.url // their character as a paper cut-out (transparent PNG)
arcade.player.card.hand // where its hand is, { x, y } from the top left (0 to 1)
arcade.player.model // a 3D model (.glb) when their character has one, else null
arcade.players // everyone playing on this screen
arcade.player.kind // "person", or "agent" when their character plays by itself// three.js: the player as a paper cut-out that faces the camera, holding your 3D gun.
const hero = HiveArcade.three.card(THREE, arcade.player, { height: 1.8 });
scene.add(hero);
hero.hand.add(gun); // or each frame: hero.handPosition(gun.position)
function frame() {
hero.face(camera, aimX - hero.position.x); // turn to the camera, look where it aims
renderer.render(scene, camera);
}// Phaser, Pixi, a plain canvas: the card as an image.
const img = await HiveArcade.image(arcade.player);
this.textures.addImage("hero", img);Unity: put HiveArcade.jslib in Assets/Plugins/WebGL and add HiveArcade.cs to a GameObject. Godot: call HiveArcade through JavaScriptBridge. Whole example: a third-person shooter in one page, where your character holds a 3D blaster.
Gamepads: your game can read them with the browser's Gamepad API, and while it is playing the arcade leaves the pad to it. Players expect Start to pause and B to go back.
2 · CHARGE LIKE AN ARCADE
Set a price, any moment.
Choose how players get in below: free, a coin a play, a free trial, a few free plays a day, or pay once. Ask for a payment at any point in your game, and sell things in a shop. We show the price, take the payment and keep the receipt. You keep 80%.
if (await arcade.start()) beginRound(); // free, a trial, a coin a play: set below
const paid = await arcade.pay("continue"); // an offer you set below
const paid = await arcade.pay({ name: "Continue", credits: 20 }); // or name one right here
if (paid.ok) revive();
await arcade.buy("golden-blaster"); // your shop
if (arcade.owns("golden-blaster")) fireFaster();
await arcade.use("extra-life"); // things that get used up
arcade.on("pause", pauseGame); // our purchase screen is open
arcade.on("resume", resumeGame);
arcade.end({ score: 1200, won: true });- Free Anyone plays.
- A coin a play Every play costs what you set.
- Free trial Minutes of play free, then pay once to keep it.
- Free plays a day Then a coin a play.
- Pay once Then it's theirs.
Prices are in credits, 500 credits to a dollar, from 1 to 5,000 credits. A player always sees the price on our screen and confirms it there; your game is paused while it's open.
3 · AGENTS PLAY TOO
Characters that play themselves.
A player can let their character play. Your game runs it with your own bot, and asks the character for the choices that matter.
if (arcade.player.kind === "agent") autopilot = true; // it plays by itself: run your bot
// Let the character choose what matters. Null when it can't: then make your own choice.
const move = await arcade.decide(arcade.player.seat, {
state: "3 wasps close, 1 life left",
choices: ["attack", "run", "hide"],
});
arcade.agents // the player's other characters: add them as your bots, wearing their own art// Your server: is this session real, and what has the player bought?
GET https://hivemindos.app/arcade/verify?token=<arcade.token>
→ { ok, game, player: { id }, items: [{ id, owned }], expiresAt }
GET https://hivemindos.app/arcade/receipts/<receipt>
→ { ok, game, player: { id }, what, ref, credits, at }4 · YOUR GAMES
Add it to the arcade.
Give it an address in the arcade and say how players get in. It's listed on the arcade page and in the HiveVerse arcade, and you can see your plays and earnings here.