Examples
Use the examples repository as runnable tutorials. Each example is a normal game project that can be built locally and deployed with vifu deploy.
git clone --recurse-submodules https://github.com/vifu-labs/vifu-examples
cd vifu-examples01. Getting Started
01_getting_started/hello_web is the smallest useful Vifu game. It teaches the project shape, setup, static assets, and deploy flow.
cd 01_getting_started/hello_web
vifu deployUse this example when you want to understand the minimum files Vifu needs.
02. AIventure
02_external_ai_games/aiventure shows how to adapt an existing Angular + Phaser AI game. It keeps the game structure recognizable while routing model calls through Vifu AI.
cd 02_external_ai_games/aiventure
npm install
vifu deployUse this example when you already have a browser game and want to bring it to Vifu without rewriting the whole project.
What Examples Teach
| Folder | What it teaches |
|---|---|
01_getting_started/hello_web | Smallest deployable Vifu static web game. |
02_external_ai_games/aiventure | Adapting an existing Angular + Phaser AI game to Vifu AI and deploy policy. |
Good Example Shape
A useful Vifu example should:
- be playable without reading docs first
- have clear Vifu project setup
- use
vifu deployfrom the example folder - show at least one visible Vifu platform feature
- keep deterministic local fallback behavior where useful
- call Vifu AI/backend services through the SDK
- avoid remote executable code in the deployed build
Existing Game Adaptation
When adapting a third-party or hackathon game:
- Keep upstream history visible, usually as a submodule or fork.
- Run
vifu setup. - Confirm a static build output.
- Replace direct AI/backend calls with
vifu.aior another SDK facade. - Remove unused local/remote AI providers from the deployed bundle.
- Run
vifu deploy.
See Deploy Policy for why remote JavaScript imports are blocked.