Overview
This tutorial builds a face-controlled mini-game by opening the BlinkFlyer template and learning how its pieces fit: a Lua script drives the game, text layers show the score and lives, and a blink controls play. By the end you will understand how a game filter is assembled and how to change it.
Product: Nosmai Studio · Platform: macOS, Windows · Updated: 6 October 2026 · Reading time: 20 minutes
Prerequisites
- You have finished Make your first filter.
- Everything mode, so the Code panel is available.
- A working camera.
1. Open the template
- On the home screen, open Templates.
- Open BlinkFlyer. It loads as editable layers.
2. Play it on a device
A game's Lua script runs on a device, not inside Studio, so you play the game on a phone through the Companion app:
- Connect a device. See Preview on a device for the full steps (same Wi-Fi, open the Companion app, it connects).
- Send the filter to the device with Preview on device.
- On the phone, blink to make the flyer move. The score and lives update on screen as you play.
In Studio's own preview you can see the game's layers, but the game does not play, because Studio has no Lua interpreter. The game runs because the filter's type is set to run as a game, which starts the Lua runtime on the device.
3. See how the game text works
The score, lives, and status you see are text layers bound to values the script sets live:
- Open the Code panel and find the script under Scripts.
- The panel detects the text slots the script writes (score, lives, status, countdown) and shows whether each has a matching text layer.
- If a slot had no text layer, nothing would show. The panel offers Create the missing text layers to fix that in one click.
This is the single most useful thing to understand about game filters: a script writes to a named slot, and a text layer bound to that slot displays it.
4. Change something
Try one small change and preview it:
- In the Layers panel, select a text layer (for example the score) and change its font or colour in the inspector.
- Or open the script in the Code panel and change a number, such as how many lives the game starts with. The change runs the next time you preview on a device.
5. Check performance and export
- Open the Performance view. A game is mostly shader and text, so it should read Good; the by-layer list shows what each piece costs.
- Press Export and produce the
.nosmaipackage when you are happy.
Verify it worked
- Blinking controls the flyer in the preview.
- The score and lives update on screen as you play.
- The Code panel shows every text slot with a matching text layer.
- The exported folder contains a
.nosmaifile.
Common problems
| What you see | Why | Fix |
|---|---|---|
| The game does not respond to a blink | The filter is not set to run as a game | Set the filter to run as a game in the Code panel |
| The score or lives do not show | A written text slot has no matching text layer | Use "Create the missing text layers" in the Code panel |
| A script change did nothing | Studio has no Lua interpreter; scripts run on a device | Preview on a device, where the script runs |
| The flyer moves erratically | Blink detection needs a clear, well-lit face | Improve the lighting and face the camera directly |