# Your first game

A coin rush in ten minutes, with bricks and no code.

This makes a round-based game where players grab coins and the most coins
when the clock runs out wins. No scripting.

## 1. A room with things

Walk into your game and open the Studio. Drag a few mints from your bag into
the room: something to stand on as a spawn, and something small to be the
coins. Each mint you drop joins the game's **stock**, and every copy you place
after that is an **instance** of it.

## 2. Rules on the game

Select GAME in the hierarchy. Add these bricks:

- **Rounds**: 90 seconds, waits for 2 players, a 5 second countdown.
- **Winner**: most points when time is up.
- **Score**: called COINS.

That is the whole game loop: waiting, countdown, the clock on the HUD, the
winner, results, the next round.

## 3. Bricks on things

Select the thing players should start on and add a **Spawn** brick. Select
one coin and add a **Pickup** brick: 1 point, back after 10 seconds. If you
add the Pickup to the coin's **item** rather than to the one instance, every
coin you place gets it.

## 4. Test and publish

TEST walks you into a private copy of the draft. Invite a friend with the
chat line, or open a second account. PUBLISH ships it: from then on the door
leads to the published version, and the draft is yours to keep working on.

## The same game as files

Pull it and you'll see exactly what you built:

```
eggox pull "Coin Rush"
cat "Coin Rush/rooms/Coin Rush/room.json"
```

```json
{
  "rules": [
    { "kind": "rounds", "seconds": 90, "min": 2, "countdown": 5, "results": 8 },
    { "kind": "winner", "by": "points" },
    { "kind": "score", "name": "COINS" }
  ],
  "things": [
    { "id": "placed_…", "thing": "Stone Pad", "x": 12, "y": 12, "bricks": [{ "kind": "spawn" }] },
    { "id": "placed_…", "thing": "Gold Coin", "x": 8, "y": 6 }
  ]
}
```

Change a number, `eggox push`, and it is the draft.

