Skip to content

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.

bash
git clone --recurse-submodules https://github.com/vifu-labs/vifu-examples
cd vifu-examples

01. Getting Started

01_getting_started/hello_web is the smallest useful Vifu game. It teaches the project shape, setup, static assets, and deploy flow.

bash
cd 01_getting_started/hello_web
vifu deploy

Use 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.

bash
cd 02_external_ai_games/aiventure
npm install
vifu deploy

Use this example when you already have a browser game and want to bring it to Vifu without rewriting the whole project.

What Examples Teach

FolderWhat it teaches
01_getting_started/hello_webSmallest deployable Vifu static web game.
02_external_ai_games/aiventureAdapting 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 deploy from 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:

  1. Keep upstream history visible, usually as a submodule or fork.
  2. Run vifu setup.
  3. Confirm a static build output.
  4. Replace direct AI/backend calls with vifu.ai or another SDK facade.
  5. Remove unused local/remote AI providers from the deployed bundle.
  6. Run vifu deploy.

See Deploy Policy for why remote JavaScript imports are blocked.