# Make a game

> Describe your game to your Agents, play it in Preview with touch, Rotate and your Mac's keyboard, ask for changes, and add art and sound.

Source: https://air.build/docs/build/make-a-game/

You make a game the way you make any app in AirBuild. You describe it in the project's chat, your Agents write and build it, and you play it in Preview. This page covers what's different for a game: how it's held, how you work its controls in Preview, what Preview can't pass on to the device, and where to get its art and sound.

## Describe the game

1. Start a project for the game, or open the project's chat. See [Make your first app](https://air.build/docs/get-started/first-project/#start-a-project).
2. Say what the player does, how they score, win or lose, and how they control it.
3. Say how the game is held, upright or on its side, and whether it's for iPhone, iPad or both.
4. Send it. Your Agents answer in the chat and build the game.

For example:

```text
A game where a fox runs along a forest path and jumps over logs. Tap anywhere to jump. Each log cleared is a point. Played on its side on iPhone. Show the score at the top, and a Game Over screen with the best score and Play Again.
```

| Say | For example |
| --- | --- |
| The controls | "Tap to jump", "drag to steer", "buttons for left, right and fire at the bottom" |
| How it's held | "On its side only", "upright only" |
| The screens | A start screen, a pause button, a Game Over screen |
| What it keeps | The best score, unlocked levels, settings |

If you want to try every control in Preview, ask for controls Preview can pass on. See [What Preview can't do](https://air.build/docs/build/make-a-game/#what-preview-cant-do).

## Play it in Preview

When the build is ready, the project's chat shows **New version ready** with **Open Preview**. See [Open the Preview when a new build is ready](https://air.build/docs/build/open-the-preview-when-a-build-is-ready/), and [Run your app in Preview](https://air.build/docs/build/preview-your-app/#open-preview) for the device menu and the controls.

### Turn the device for a game played on its side

Preview doesn't turn the device when the game opens; only **Rotate** does. A game made to be played on its side opens sideways in the upright device. Tap **Rotate** until the game stands upright: each tap turns the device a quarter turn clockwise. See [Type, rotate and add devices in Preview](https://air.build/docs/build/use-preview-tools/#turn-the-device) for where **Rotate** is on each device.

The device stays turned until you tap **Rotate** again. Go **Home** and the Home Screen is on its side, as on an iPhone held that way. If the game was already on its side when you opened Preview, the device starts turned.

On iPhone, AirBuild itself stays upright, so a turned device is drawn across the screen. For more room, use **Enter Full Screen**. See [Type, rotate and add devices in Preview](https://air.build/docs/build/use-preview-tools/#use-preview-full-screen).

### Work the controls

**iPhone**

Touch the device's screen the way you would touch the game. Preview passes on one or two fingers at a time.

AirBuild on iPhone and iPad doesn't pass a keyboard on to the device.

**Mac**

Click and drag on the device's screen: the pointer is one finger. A pinch or a turn of two fingers on the trackpad goes to the device as two fingers.

Click the device's screen once, then use your Mac's keyboard: the arrow keys, letters, numbers, Space, Return, Tab, Escape and Delete go to the device. A game gets the keys only if it's made to read a keyboard; ask your Agents for keyboard controls if you want them. See [Type, rotate and add devices in Preview](https://air.build/docs/build/use-preview-tools/#type-text-on-the-device-mac).

Each key goes to the device as one press. Preview doesn't tell the device that a key is being held down, so a game where the player keeps moving while a key is held won't see the key held.

Preview plays the game's sound. To turn it off, switch off **Device Sound** in the **Sound** menu; on iPhone and iPad, **Mute** under the device does the same. See [Run your app in Preview](https://air.build/docs/build/preview-your-app/#use-the-device).

### What Preview can't do

| In the game | In Preview |
| --- | --- |
| A game controller | Preview doesn't pass a controller on to the device. |
| Tilting or shaking the phone | Preview has no way to tilt or shake the device. It sends touches, keys, the device's buttons and turns. |
| Three or more fingers | Preview passes on two fingers at most. When a finger lands or lifts while another is down, the device sees every finger lift and land again, so holding a control with one thumb while tapping with the other may not work as it does on an iPhone. |
| Holding a key down | Each key is a single press (Mac). |
| Vibration | You don't feel it in Preview. |

Preview shows you the device's screen as a video stream. Check how fast the game feels, and everything in this table, on your own iPhone. See [Play it on your iPhone](https://air.build/docs/build/make-a-game/#play-it-on-your-iphone).

## Ask for changes

Tell your Agents in the project's chat what to change. Say what you saw and what you want instead:

```text
The logs come too fast after 20 points. Make the jump a little higher, and add a pause button at the top right.
```

To point at something on the screen, use **Screenshot** or **Draw** in Preview and send it. After the next build, tap **Reinstall** (on iPhone, the app's icon, **Restart App**) to start the new build from the beginning.

To see a run-through without playing it yourself, ask an Agent for a video. See [Record a video of your app](https://air.build/docs/build/record-a-video-of-your-app/).

## Add art, sound and 3D models

Your Agents can make the game's pictures, sounds and models, send them to the chat for you to check, and then put them in the game:

- Characters, backgrounds and items: [Have Agents make pictures for your app](https://air.build/docs/build/make-pictures-for-your-app/).
- Sound effects and music: [Add sound effects, music or a voice to your app](https://air.build/docs/build/add-sound-and-music/).
- 3D characters and objects: [Add 3D models to your app or game](https://air.build/docs/build/add-3d-models/).

## Play it on your iPhone

To play with your own hands, a controller, tilting or vibration, put the build on your iPhone:

- Install it from AirBuild. See [Install your app on your iPhone](https://air.build/docs/build/install-on-your-iphone/). Installing from AirBuild is in the TestFlight and direct-download builds of AirBuild, not the App Store build.
- Or get it through TestFlight. See [Share a beta with TestFlight](https://air.build/docs/app-store/test-with-testflight/).

## More for games

- Leaderboards and achievements: [Add Game Center leaderboards and achievements](https://air.build/docs/app-store/add-game-center-leaderboards/).
- A game for PSP, PS Vita or Nintendo 3DS: [Make an Android or PocketJS version (beta)](https://air.build/docs/build/android-and-pocketjs/#try-the-pocketjs-app). Its page lists the keys that work the handheld's buttons.

## Questions

**The game is on its side in Preview.**

Tap **Rotate** until it stands upright. Preview doesn't turn the device by itself.

**A swipe from the top or bottom edge leaves the game.**

Preview takes a press that starts at the very top or bottom of the screen, as you see it, as a swipe from that edge, as on an iPhone. Start a little further in, or ask your Agents to keep the controls away from the edges.

**My keys don't do anything.**

Keys reach the device only from AirBuild on the Mac. Click the device's screen first, so the keys go to it and not to the chat. If they still do nothing, the game doesn't read a keyboard: ask your Agents for keyboard controls.

**Can I play with a game controller?**

Not in Preview. Ask your Agents for controller support, then try it on your own iPhone with a controller connected to it.

**I can't hear the game.**

Check that the device's sound is on in Preview, and your own volume. See [Add sound effects, music or a voice to your app](https://air.build/docs/build/add-sound-and-music/#hear-them-in-your-app).
