AIventure
AIventure shows how to adapt an existing Angular + Phaser game to Vifu without rewriting the whole project.
Open The Example
bash
git clone --recurse-submodules https://github.com/vifu-labs/vifu-examples
cd vifu-examples/02_external_ai_games/aiventure
npm installWhat It Configures
AIventure is a bundled Angular project with Phaser gameplay:
npm run build-nologbuilds the browser artifact.dist/template-angular/browseris the deploy output.index.htmlis the runtime entry inside that output.- Vifu AI is enabled for NPC dialogue and game actions.
- Game data under
assets/gamedata/**is bundled with the runtime. - Direct external AI calls are replaced by the Vifu SDK.
The important setup values are:
json
{
"name": "AIventure",
"main": {
"url": "index.html",
"engine": "phaser"
},
"build": {
"command": "npm run build-nolog",
"output": "dist/template-angular/browser"
},
"ai": {
"dialogue": {
"role": "npc",
"tools": "game-actions"
},
"budget": {
"mode": "demo",
"turns": 8
},
"fallback": "deterministic"
},
"bundle": {
"include": ["assets/gamedata/**"]
}
}Deploy It
bash
vifu deployThe deploy check blocks remote executable code and direct browser calls to external AI providers. Keep model calls behind Vifu.ai so the game uses the platform AI service.