{"id":51231126,"url":"https://github.com/enjin/platform-sample-game-client-godot","last_synced_at":"2026-06-28T16:30:37.658Z","repository":{"id":367135994,"uuid":"1271339644","full_name":"enjin/platform-sample-game-client-godot","owner":"enjin","description":"A sample game client written using the Godot Engine to interact with Enjin Platform Cloud via a dedicated game server.","archived":false,"fork":false,"pushed_at":"2026-06-24T17:55:29.000Z","size":66650,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-06-24T19:05:33.135Z","etag":null,"topics":["godot","sample-game","sample-project"],"latest_commit_sha":null,"homepage":"","language":"GDScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/enjin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-16T15:07:12.000Z","updated_at":"2026-06-24T17:56:20.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/enjin/platform-sample-game-client-godot","commit_stats":null,"previous_names":["enjin/platform-sample-game-client-godot"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/enjin/platform-sample-game-client-godot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enjin%2Fplatform-sample-game-client-godot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enjin%2Fplatform-sample-game-client-godot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enjin%2Fplatform-sample-game-client-godot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enjin%2Fplatform-sample-game-client-godot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/enjin","download_url":"https://codeload.github.com/enjin/platform-sample-game-client-godot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enjin%2Fplatform-sample-game-client-godot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34896652,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-28T02:00:05.809Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["godot","sample-game","sample-project"],"created_at":"2026-06-28T16:30:36.983Z","updated_at":"2026-06-28T16:30:37.649Z","avatar_url":"https://github.com/enjin.png","language":"GDScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Enjin Platform Sample Game (Godot)\n\nA small top-down farming game that shows how **Enjin blockchain features fit\ninto a real game loop**. You log into a managed wallet, earn on-chain tokens by\nplaying, see them in an in-game backpack, and burn or send them to another\nwallet — all driven by ordinary gameplay rather than a separate \"wallet app\".\n\nIt's built in Godot 4 and talks to the\n[Enjin Platform sample game server](https://github.com/enjin/platform-sample-game-server)\nover plain HTTP. The server owns a managed daemon wallet and submits the\non-chain transactions, so the game itself only makes simple REST calls.\n\n## What it demonstrates\n\n- **Managed-wallet login** — register/login with an email + password; the\n  server returns a session token tied to a wallet the player never has to\n  manage directly.\n- **Minting from gameplay** — tilling soil occasionally turns up a collectible\n  (a gold coin or a gem). Picking it up mints that token to your wallet\n  on-chain, so a normal game action produces a real blockchain asset.\n- **Reading the wallet** — the backpack lists the tokens your wallet actually\n  holds, fetched live from the chain.\n- **Melting \u0026 transferring** — burn a token, or send it to any other wallet\n  address, straight from the backpack.\n- **A collection of token types** — the game's collectibles (`gem_green`,\n  `gold_coin`, `gold_coin_blue`) belong to one on-chain collection; you stamp\n  your server's collection id onto them once so the wallet view lines up.\n\nEverything blockchain-related is optional: with no server running, the game is\nfully playable and the wallet features simply no-op.\n\n## Prerequisites\n\n- **Godot 4.4+** (standard build; no .NET / Mono required).\n- The **Enjin Platform sample game server**\n  ([`enjin/platform-sample-game-server`](https://github.com/enjin/platform-sample-game-server))\n  running on `http://localhost:3000` (its default).\n\n## Quick start\n\n### 1. Start the game server\n\nFollow the setup instructions in the server repository. On first run it creates\na managed daemon wallet and a Collection on-chain, persists them, and exposes\nthe collection id at `GET /api/setup/collection-id`.\n\n### 2. Open the project in Godot\n\n```bash\ngodot4 --editor .\n```\n\n(Or \"Import\" the folder from Godot's Project Manager.)\n\n### 3. Point the token assets at your collection\n\nThe three collectible definitions — `resources/items/gem_green.tres`,\n`gold_coin.tres`, and `gold_coin_blue.tres` — ship with a placeholder\ncollection id (`-1`). Each needs *your* server's collection id before your\nwallet's tokens line up in the backpack. Set it one of two ways:\n\n**Automatic (recommended).** With the server running:\n\n1. **Project → Tools → Stamp Collection ID onto EnjinItem Assets**.\n2. Confirm the server URL (default `http://localhost:3000`).\n3. The tool reads `GET /api/setup/collection-id` and writes it onto all three\n   token assets.\n\n**Manual.** Select each of the three `.tres` files in the FileSystem dock and\nset the fields in the **Inspector**:\n\n- **Collection Id** — your server's collection id (from\n  `GET /api/setup/collection-id`, or the server's `state.json`). Use the same\n  value on all three.\n- **Token Id** — the token's id *within* that collection. The demo uses\n  `1` = Gold Coin, `2` = Gold Coin (Blue), `3` = Green Gem. Leave these unless\n  your collection uses different ids; whatever you set here is the id the game\n  mints / melts / transfers for that collectible.\n\nYou can also edit the `collection_id = \"…\"` and `token_id = \"…\"` lines in the\n`.tres` files directly — they're plain text.\n\n### 4. Play\n\nRun the project (**F5**). The flow is: loader → main menu (register/login) →\nfarm.\n\n| Input | Action |\n|-------|--------|\n| WASD / arrows | Move |\n| Mouse + left click | Use the equipped item on the targeted tile / interact |\n| Q / E or mouse wheel | Cycle the equipped item |\n| Click a hotbar slot | Equip that slot |\n| B (or the backpack icon, top-right) | Open the blockchain backpack |\n| Click the market stall / warehouse | Open the market / warehouse panel |\n| Menu button (top-right) | Settings (resolution, fullscreen, volume, login, quit) |\n| Weather icons (under the clock) | Toggle sun / rain / thunder |\n| F5 / F9 | Save / load (`user://save.sav`) |\n| Esc | Close the open panel |\n\n## The blockchain features, in play\n\n1. **Log in.** Use the register/login form on the main menu (or the **Menu →\n   Settings** panel in-game). The server registers-or-logs-in and hands back a\n   session token; the game stores it and fetches your wallet.\n2. **Earn a token.** Equip the hoe and till soil. Tilling has a chance to reveal\n   a coin or gem in the world — click it (or walk over it) to pick it up, which\n   mints that token to your managed wallet.\n3. **Check your wallet.** Press **B** (or the backpack icon, top-right). The\n   backpack reads your wallet's token balances from the chain and lists them.\n4. **Melt or transfer.** From the backpack, burn a token (melt) or paste a\n   recipient wallet address and send it (transfer).\n\nOn-chain mint/melt/transfer wait for finalization server-side and can take\n**10–20+ seconds**; the backpack's status line tells you while it refreshes.\n\nThe rest of the loop is ordinary farming: water planted crops with the can\n(crops only grow while watered), harvest with the basket, then **sell produce\nand buy seeds at the market stall** or **stash/retrieve items at the\nwarehouse**. Walk into the house door to go inside.\n\n## How the integration is wired (for developers)\n\nIf you're here to see how a game calls Enjin, these are the files to read:\n\n| File | Role |\n|------|------|\n| `scripts/enjin/api/enjin_api_service.gd` | Thin REST client — one method per server endpoint |\n| `scripts/enjin/core/enjin_manager.gd` | Session/auth state, wallet cache, mint/melt/transfer, the till-time token reveal |\n| `scripts/enjin/data/` | Plain data models for wallet/token responses |\n| `scenes/ui/backpack_ui.tscn` + `scripts/enjin/ui/` | The backpack: wallet token list with melt/transfer controls |\n| `scenes/enjin/enjin_token.tscn` | The world pickup that triggers a mint |\n| `resources/items/{gem_green,gold_coin,gold_coin_blue}.tres` | The token definitions (collection id stamped by the editor tool) |\n| `addons/enjin_editor/` | The \"Stamp Collection ID\" editor tool |\n\n### Server API the game uses\n\n| Method | Path                        | Auth   | Purpose |\n|--------|-----------------------------|--------|---------|\n| GET    | `/api/auth/health-check`    | none   | Liveness ping |\n| POST   | `/api/auth/register`        | none   | Register-or-login; returns `{ token, email, wallet }` |\n| POST   | `/api/token/mint`           | bearer | `{ tokenId, amount }` |\n| POST   | `/api/token/melt`           | bearer | `{ tokenId, amount }` |\n| POST   | `/api/token/transfer`       | bearer | `{ tokenId, amount, recipient }` |\n| GET    | `/api/wallet/get-tokens`    | bearer | `{ account, tokenAccounts[] }` |\n| GET    | `/api/setup/collection-id`  | none   | Used by the editor tool |\n\n## Verify the integration end-to-end\n\nTwo harnesses exercise the server without playing the game:\n\n- `scenes/debug_enjin.tscn` — a button per REST endpoint.\n- `smoke/game_server/game_server_smoke.tscn` — a scripted run through\n  health → login → mint → melt → transfer with wallet dumps. Copy\n  `smoke_config.example.tres` → `smoke_config.tres` (gitignored) and fill in\n  credentials, or pass env vars. Headless / CI:\n\n```bash\nSMOKE_EMAIL=player@example.com SMOKE_PASSWORD=secret \\\ngodot4 --headless --path . smoke/game_server/game_server_smoke.tscn -- --quit-after-smoke\necho $?   # 0 = all steps passed\n```\n\n## Exporting\n\n`export_presets.cfg` ships macOS / Windows / Linux presets (GL Compatibility\nrenderer, safe everywhere). Install export templates once via **Editor → Manage\nExport Templates**, then e.g.:\n\n```bash\ngodot4 --headless --path . --export-release \"Linux\" build/linux/platform-sample-game.x86_64\n```\n\n`build/` and `export_credentials.cfg` are gitignored, and the populated smoke\nconfig is excluded from exports.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenjin%2Fplatform-sample-game-client-godot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fenjin%2Fplatform-sample-game-client-godot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenjin%2Fplatform-sample-game-client-godot/lists"}