Build Your First Game
This walkthrough builds a tiny coin collector. It is small on purpose: by the end you will have used the core Opal loop of create project, place objects, add state, wire behavior, show UI, play-test, publish, export.
You can use starter assets, your own files, or quick prepared art from Asset Studio.
What You Will Make
| Part | Behavior |
|---|---|
| Player | A visible object in the scene |
| Coin | Tapping it adds score, plays feedback, and removes the coin |
| Score | A GameState variable named score |
| HUD | A label that shows score |
| Play mode | The game runs in the editor viewport |
| Publish | A playable build on the arcade |
| Export | A .opal backup |
1. Create A Project And Scene
- Open
/createon the hosted site. - Sign in if prompted.
- Open the Project picker.
- Create a project named
Coin Collector. - Open the Scene picker.
- Create or rename a scene to
Level 1. - Make
Level 1the start scene if the scene/project controls show that option.
Keep the scene simple. You only need a background, player, coin, and HUD.
2. Add Art
Use one of these approaches:
| Approach | Steps |
|---|---|
| Starter assets | Open the Assets tab, pick an image, place it on the stage |
| Your files | Use Add -> Add Art, choose image files, and place them |
| Prepared art | Use Add -> Cutout Tool, save the result, then place it |
| Frame animation | Use Art to create a .ssb bundle, then use it later in Flow |
Place one object for the player and one object for the coin.
Rename them in the inspector:
Player
CoinGood names matter because Flow, UI bindings, Graph Explorer, and debugging tools use object names.
3. Configure The Coin
Select Coin in Arrange.
In the inspector:
- Make sure it is visible in play.
- Enable interaction if the object is not already tappable.
- Keep it above the background so pointer input can reach it.
- Optionally set a simple tap feedback action if available.
If taps do not work later, return here first. Most tap problems are either "not interactable" or "another object is covering it."
4. Add A Score Variable
Open Variables in the top bar.
Create:
| Name | Type | Default |
|---|---|---|
score | Number | 0 |
This creates the project GameState variable score. Flow reads and writes it through Add Counter / Set variable / Get nodes; UI bindings can use self.score.
5. Wire The Coin Tap
Select Coin, then open the Object Flow workspace.
Create an Object Flow rule:
On Tap
-> Add Counter / Add to variable (score, 1)
-> Play Audio (optional)
-> Spawn VFX (optional)
-> DestroyDetailed steps:
- Add an On Tap event rule (this also ensures Interactable is on the coin).
- Add Add Counter (catalog label; writes the GameState variable) from the state/variables nodes and set
keytoscore,valueto1. - Add Play audio if you imported a sound — or bake a pickup blip in Sound Canvas first.
- Add Spawn VFX and choose a small preset such as sparkle.
- Add Destroy so the coin disappears after collection.
- Connect the white execution wire through each node in order.
Press Play in viewport and tap the coin. The coin should disappear and score should increase.
6. Add A HUD Label
Open the UI workspace.
- Add a Text element.
- Name it
ScoreLabel. - Place it near the top-left or top-right of the screen.
- Bind the text to the GameState variable (expression binding on
props.text):
=`Score ${self.score}`The UI runtime reads project GameState through self, so self.score maps to the score variable you declared.
7. Add A Simple Win Rule
Open Scene Flow.
For a one-coin test, you can keep this tiny:
On Scene Start
-> wait or timer loop
-> branch: score at least 1
-> Say "You got the coin!"For a real level, use a custom event:
Coin / On Tap
-> Add Counter score +1 # GameState
-> Emit Event coin_collected
-> Destroy
Scene Flow / On Custom Event coin_collected
-> branch score at least 5
-> Go To Scene Win ScreenThis keeps object behavior local and win/lose logic global.
8. Play-Test
Use this loop:
- Press Play in viewport.
- Tap the coin.
- Toggle Flow overlay while playing to see nodes fire.
- Toggle Stats if runtime state or performance looks suspicious.
- Press Stop.
- Adjust the graph or scene.
Do not wait until the project is large to test. Opal is designed for tiny edit-play cycles.
9. Publish To The Arcade
When the game works:
- Confirm the correct start scene is set.
- Use File -> Publish to Arcade....
- Choose whether the published game can be remixed.
- Save the public link Opal gives you.
- Open the link in another tab to test it outside the editor.
Publishing can happen early. A tiny published build is useful because it proves the game runs for players, not only inside your editor session.
10. Export A Backup
Use File -> Export Game to download a .opal bundle.
Use this export as:
- A milestone backup
- A file to move to another machine
- Input for a standalone player build
- A small repro if you report a bug