Start here · Chapter 7

Games

Describe a game and Chirai builds a game: it reads what you asked for before anything else. "Build a 2D space shooter" gets game questions and a playable game, never website pages, payments or sign-in. A website about games ("a site for my board game café") is still a website.

What you get

  • A browser game that plays on phones and computers, built with Phaser (2D) or Three.js (3D, when you say 3D).
  • The full loop: a menu, the game, score and lives, a game-over screen and Play again, pause, and a mute button.
  • Controls for both: keyboard on computers, touch on phones.
  • Sound without files: short effects (shoot, hit, pick-up, game over) made in the browser.
  • Scores: the best score saved on the player's device, and an online leaderboard once the game is published.
  • A share preview: title, description and icon when the link is shared.

Games are always written by Chirai ultra, whichever brain is switched on, because game code has to be exactly right to play.

The questions

Instead of pages and payments, Chirai asks about the game itself:

  • The name.
  • How a round works: score attack, levels, or endless.
  • The controls: keyboard and touch, mouse or tap only, or one button.
  • Extras: power-ups, a boss, rising difficulty, sound, pause, a saved best score.
  • The look: three colour palettes to pick from.
  • Anything specific: for example "the ship fires lasers, asteroids split in two, 3 lives".

What kind of game it is

Chirai works out the kind of game from your words, and each kind gets what players expect of it:

KindFor exampleWhat Chirai writes
Platformer"a game like Mario"3 levels several screens wide, a following camera, enemies to stomp, coins, blocks, a flag at the end
Board gameLudo, chess, snakes and laddersThe full rules in their own file, a CPU opponent, animated moves, turns
Puzzlematch-3, 2048, sudokuThe puzzle logic, animated moves, levels and goals
Shooter / runner / racingspace shooter, endless runner, kart racerEnemy waves or obstacle patterns, power-ups, laps

Characters, enemies and tiles are drawn as pixel art, with particles, screen shake and sound on every hit.

Before you see it: the Test Agent plays it

When the preview opens, Chirai first reads the game's code against that list (a game review): a missing rule or a level that's one screen wide goes to IILA. Then the Test Agent plays the game in a real browser:

  1. Open: the game draws a screen (not blank, no errors).
  2. Start: a click, Enter or Space starts play.
  3. Move: the arrow keys, WASD, or dragging move the player. A board or puzzle game is played with clicks and taps instead, and the turn has to pass to the next player.
  4. Act: shooting, jumping or tapping does something (new objects, a higher score).
  5. Lose: losing the last life ends the game on a game-over screen (not measured for board and puzzle games, which take longer than a test).
  6. Play again: the game-over screen starts a new round.

It also checks for things a player would only feel: objects that collide but can't be seen, files the game loads that don't exist, and a game running slowly.

What it finds goes to IILA as one report. IILA fixes the game, the Test Agent plays it again, and the fix is kept only if that playthrough is better. You see each step in the Studio. Before all this, the game's code is also type-checked, and every error is fixed the same way.

Keep it realistic

A focused first version plays best. Build that, then add to it by telling IILA in plain words ("add a boss every 5 waves", "make the enemies faster").

Not in a first version:

  • online multiplayer
  • in-game purchases or ads
  • app-store builds (the game plays in the phone's browser and can be added to the home screen)
  • very large worlds or long stories
  • characters, music or art from other games or films. Chirai draws its own, or you add your own files.

A prompt that works

Build a 2D space shooter called Star Drift.
The ship moves left and right at the bottom and fires lasers.
Asteroids fall from the top; big ones split in two when hit.
3 lives, a power-up every 30 seconds (double shot), and it gets faster every wave.
Neon colours on a dark background.