mini-world / README.md
victor's picture
victor HF Staff
Initial deployment of Mini World game
a2d0320 verified
---
title: Mini World
emoji: 🌍
colorFrom: green
colorTo: blue
sdk: docker
app_port: 7860
---
# Mini World
A real-time AI-powered exploration game where an AI agent navigates a procedurally-generated 2D emoji world.
## Features
- 🚢 AI agent that autonomously explores a 600x600 world
- πŸ’Ž Collectible diamonds scattered across the map
- 🌳πŸͺ¨ Procedurally generated terrain using Perlin noise
- Real-time updates via Server-Sent Events (SSE)
## Environment Variables
Set these in your Hugging Face Space settings:
- `HF_TOKEN` (required) - Your Hugging Face API token for model access
## Local Development
```bash
# Install dependencies
bun install
# Start the server
HF_TOKEN=<your-token> bun server.ts
```
The server runs at http://localhost:7860 (or set `PORT` env var)
## Architecture
- **server.ts** - HTTP server with SSE streaming
- **aiService.ts** - AI inference using OpenAI SDK with HuggingFace router
- **gameState.ts** - Game world and state management
- **index.html** - Frontend UI