OhMyGame
OhMyGame is the open-source studio for making games with AI. Design, build, playtest, and publish games in one app, with your own model keys.
Programe gladiadores em C, Python ou blocos e veja seu código lutar na arena.
Translation pending
GamesJavaScript · PHPGitHub @werlangOnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
No updates detected yet. GitHub releases will appear here.
Owners of public repositories under a personal GitHub account can sign in to verify ownership and manage the introduction themselves. No administrator approval is needed.
Sign in, generate a verification file, and commit it to this repository’s default branch within 30 minutes. Files on other branches or forks do not count. Then check the file below to manage the project without administrator approval. Keep the file to retain your access.
If needed, you will go to sign-in. After signing in, return here and press your chosen verification button again.
Run /nomorevibe verify in your project folder to verify ownership and manage the introduction yourself.
Verify in one minuteAsk about other verification options
Sistema de batalha de gladiadores virtuais programáveis.
Translation pending
Taken from the repository README
Loading the full README.
Read the full README ↗gladCode is a web-based programming game and arena where players code AI gladiators in C or Python to battle autonomously. The platform features selectable Phaser.js 2D and Three.js top-down 3D battle replays, visual block-based programming (Blockly), raw C/Python editing (ACE Editor), tournament systems, and live WebSocket notifications.
gladCode 2 runs as a microservices architecture managed via Docker Compose:
flowchart TD
User([User Browser]) -->|HTTP / PHP Pages| Apache[Apache / PHP 8 Frontend\npublic_html:80]
User -->|WebSockets| Node[Node.js WebSocket Server\nnode:3000]
Apache -->|MySQL Driver| DB[(MySQL 8.0 Database\nmysql:3306)]
Node -->|MySQL Driver| DB
Apache -->|POST /:dirname| Runner[Runner Express API\nrunner:3000]
Runner -->|Spawn Container| VM[gladcode2-vm Container\npswerlang/gladcode2-vm]
VM -->|Compile & Run| Payload[C Simulation Engine\npayload/gladCodeServerMain]
Payload -->|Socket IPC| GladiatorCodes[User Gladiator Codes\ncode0.c, code1.c...]
Payload -->|Generates| SimLog[simlog JSON]
SimLog -->|Expand incremental frames| Playback[Shared Playback State\nscript/render2/battle-state.js]
Playback -->|Classic 2D| Phaser[Phaser.js Renderer\nscript/render.js]
Playback -->|Coliseum 3D| Three[Three.js Renderer\nscript/render2.js]
| Service | Location | Tech Stack | Role & Responsibilities |
|---|---|---|---|
| Apache / PHP Frontend | public_html/ | PHP 8, Apache, jQuery, Phaser.js, Three.js | Web UI, user auth, gladiator management, tournament routing, simulation invocation, and selectable battle replay rendering |
| Runner Service | runner/ | Node.js (ESM), Express, Docker CLI | Docker-in-Docker executor. Receives battle requests, runs containerized simulations |
| WebSocket Server | node/ | Node.js, Express, Socket.IO | Real-time chat, live notification delivery, tournament updates |
| Simulation Engine | payload/ | C (GCC, pthreads, Sockets) | Multi-threaded arena server executing turn-by-turn combat between gladiator scripts |
| Database | database-2025.*.sql | MySQL 8.0 | Stores user accounts, gladiators, tournament schedules, battle logs, and stats |
[!NOTE] No Local Node/Python Requirement: Node.js and Python are not required on the host machine. All services, scripts, and compilers run inside Docker containers.
Copy environment template files:
cp .env.example .env
cp config/config.json.example config/config.json
cp node/config.json.example node/config.json
config/config.jsonlives outside the web root and is mounted into Apache at/var/www/private/config.json(seecompose.yaml). Never put secrets inpublic_html/—public_html/config.jsonis deprecated, still read as a last-resort fallback, and blocked by.htaccess. If you have one, move it:mv public_html/config.json config/config.json.
Ensure MySQL credentials in .env, config/config.json, and node/config.json match:
{
"mysql": {
"host": "mysql",
"port": "3306",
"user": "root",
"password": "root_password",
"database": "gladcode"
}
}
Start all containers in detached mode:
docker compose up -d
Service endpoints:
http://runner:3000)localhost:3306gladCode 2 includes a dev-tools suite in public_html/dev-tools/:
cd public_html/dev-tools
# Dump current MySQL database to dump_gladcode.sql
./dump_restore.sh dump
# Restore database from dump_gladcode.sql
./dump_restore.sh restore
cd public_html/dev-tools
# List test tournaments
./tournament.sh list
# Reset specific tournament by ID
./tournament.sh reset 12
# List real production tournaments (with pagination)
./tournament.sh list-real 1 10
# Reset real production tournament
./tournament.sh reset-real 45
editor.php using either visual blocks or text editing.public_html/banned_functions.json to prevent unauthorized memory/game state modification.public_html/back_simulation.php prepares a temporary run folder under public_html/runs/{hash}/ with payload/ files and user scripts (code0.c, code1.c, etc.), then sends an HTTP POST to http://runner:3000/{hash}.gladcode2-vm container with restricted CPU (--cpu-quota=50000) and a 30-second execution deadline.socket_compile.sh compiles gladiator code, launches gladCodeServerMain, and manages socket IPC between gladiators and the C game engine.simlog). script/playback.js expands it into complete frames, then the saved battle setting selects either the classic Phaser renderer (script/render.js) or the top-down Three.js renderer (script/render2.js). The 3D renderer dresses each gladiator in Synty modular models mapped and recoloured from its persisted skin, walking with a distance-driven gait and playing Synty animation clips for melee, ranged, spell, block and charge actions timed on the replay clock (pausing freezes them; replay speed scales them). Both renderers use the same 100 ms simulation cadence and authoritative arena coordinates.gladcode2/
├── .github/ # GitHub workflows & Copilot instructions
├── Dockerfile-apache # PHP 8 + Apache + Docker CLI container definition
├── Dockerfile-dind # Docker-in-Docker container definition for runner
├── compose.yaml # Docker Compose microservices specification
├── database-2025.*.sql # Database initialization SQL dumps
├── node/ # Node.js Socket.IO WebSocket server
├── payload/ # C battle simulation engine & socket API source
├── public_html/ # Apache web root (PHP backends, JS, CSS, dev-tools)
│ ├── assets/ # Runtime 3D character source, palette atlases, and weapon models
│ ├── back_simulation.php # Simulation orchestrator
│ ├── banned_functions.json# Security function filter
│ ├── dev-tools/ # Tournament & DB management CLI/Web suite
│ ├── runs/ # Temporary simulation workspace directory
│ └── script/ # Playback UI plus Phaser and Three.js renderers
│ └── render2/ # Modular Three.js arena, entities, effects, audio, camera, and state helpers
└── runner/ # Express Docker execution service
gladcode2-vm).runner/runner.js.setPosition, setHp, setAp, lvlUp, etc.) blocked during compilation.