YB
Yarn Bounce — Documentation
v1.0.0 · Unity 6+ · backend documented separately in the HyperCasual LiveOps Kit manual

Yarn Bounce

A portrait puzzle game for Unity 6 (URP), shipped as a complete, playable template on top of the HyperCasual LiveOps Kit. Tap a glass dispenser to roll its top run of matching spools onto a spring plunger, fire a volley, and watch the yarn sew itself into the fabric picture above.

Unity 6+ URP 500 Levels Portrait 3 Power-Ups

Important: Template / Starting Point

This asset is a template and starting point for your own game. It provides the mechanic, the level pipeline, 500 ready levels and a full LiveOps backend, and it is expected that you customise, extend and rebrand it. It is not a finished, ready-to-publish product — the store listing, artwork, ad unit IDs, signing keys and store products are yours to supply.

Overview

Yarn Bounce is a colour-matching puzzle. Each level is a picture made of polyomino patches, and a row of glass dispensers holding coloured spools. The player empties the dispensers into the picture, one volley at a time, until every patch is sewn.

Everything that differs between levels lives in a single ScriptableObject. The machine, camera, lighting, VFX and animation all come from shared prefabs, so a new level is a new asset and zero lines of code.

Getting Started

Requirements

Installation

  1. Import the Yarn Bounce package into your project.
  2. When prompted, import TMP Essential Resources (Window › TextMeshPro).
  3. Open Assets/YarnBounce/Scenes/YarnBounce_Game.unity for the gameplay scene, or the kit's Starter Menu scene for the full app flow.
  4. Press Play.

Quick Test

In Play mode, tap a dispenser whose top spools share a colour. They roll onto the plunger. Tap the plunger to fire. Each spool homes to a matching uncovered patch cell and sews it. Clear every patch to win the level.

The plunger chamber is strictly single-colour. Tapping a second colour while it is loaded is refused — that is the core constraint the puzzle is built on.

Folder Structure

YarnBounce/ ├── Editor/ the three buyer-facing tools plus their engine │ ├── YarnLevelEditorWindow.cs Manual Level Editor │ ├── YarnAutoLevelGeneratorWindow.cs Auto Level Generator │ ├── YarnWelcomePopup.cs Welcome │ └── YarnLevelCatalogEditor.cs level engine (no menu item) ├── Levels/ the golden showcase board, kept untouched ├── Materials/ Meshes/ Textures/ Shaders/ ├── PowerUps/ power-up definitions ├── Prefabs/ YarnMachine, YarnSpool, VFX ├── Resources/Levels/ the 500 shipped levels + the catalogue asset ├── Scenes/ YarnBounce_Game.unity ├── Settings/ palette + machine themes └── Scripts/ ├── Board/ grid, shapes, layer peeling ├── Core/ game root, level manager, input, LiveOps adapter ├── Data/ level asset, generator, solver, balancer, palette, theme ├── Mechanics/ dispensers, plunger, homing, socket row ├── PowerUps/ power-up adapter └── Visuals/ camera rig, HUD, VFX, themed parts

Gameplay

Core Mechanics

Win & Lose Conditions

Two per-level rules soften this, both editable in the Manual Level Editor: Guard Impossible Taps blocks tapping a dispenser whose colour has no reachable patch, and Recycle Unmatched Spools rolls a spool with no target back into the chamber instead of plugging a hole.

Scripts Reference

All game scripts use the YarnBounce namespace; editor tools use YarnBounce.EditorTools.

Core Scripts

ScriptDescription
YarnGameRootOwns a running level: builds the board, wires the machine, routes taps, raises the gameplay events.
YarnGameManagerBinds the campaign level, settles win/lose exactly once, credits the reward and shows the results overlay.
YarnLevelManagerFacade over the kit's progression keys — selected level, completed levels, unlock state.
YarnLiveOpsAdapterBridges gameplay to the LiveOps backend (quests, battle pass, analytics).
YarnLevelAssetOne level: grid, patches, dispensers, rules. Also validates itself.
YarnLevelGeneratorProcedural board builder used by the Auto Level Generator.
YarnLevelSolverProves a board can actually be cleared. Nothing ships unsolved.
YarnLevelAutoBalancerRebuilds dispenser supply so it exactly matches patch demand.
YarnLevelCatalogThe ordered campaign, stored as level asset names.

Utility Scripts

ScriptDescription
YarnCameraRigFrames the board for any aspect ratio, reserving bands for the HUD and the ad banner.
YarnPalette / YarnMachineThemeSpool colours, and the machine's visual identity.
YarnPowerUpAdapterImplements the four power-up effects against the running board.
YarnHaptics, YarnTween, YarnEaseSmall helpers for feel.
YarnVfxPool, YarnVfxBurst, YarnThreadTrailPooled effects for sewing, clearing and revealing.

Editor Scripts

ScriptDescription
YarnLevelEditorWindowManual Level Editor — Tools › Yarn Bounce › Manual Level Editor.
YarnAutoLevelGeneratorWindowAuto Level Generator — Tools › Yarn Bounce › Auto Level Generator.
YarnWelcomePopupWelcome window — Tools › Yarn Bounce › Welcome.
YarnLevelCatalogEditorThe engine both level tools are built on. No menu item.

Manual Level Editor

Opening the Manual Level Editor

In the Unity menu bar, go to Tools › Yarn Bounce › Manual Level Editor. This opens a dedicated editor window — no need to enter Play mode.

Features

Undo covers the board, not the file. Ctrl+Z reverses edits to the level you are looking at — painting, erasing, latching, adding or deleting a patch, Auto-Balance, the rules and booster fields. It does not reverse Save All, Delete from the campaign list, or Reload from Disk, all of which touch the files themselves.

Edit Modes

ModeClick Action
SelectClick a patch to select it. Its colour, layer and mystery flag appear below.
PatchClick cells to add them to the selected patch, or click its own cells to remove them. Drag to paint a run; the whole drag undoes as one step.
WallClick a cell to make it a wall — no patch may occupy it.
EraseClick to remove a wall, or a cell from the patch that owns it.
LatchClick a patch to latch or unlatch it. A latched level must grant UNPICK — see Level Variation.
MysteryClick a patch to hide or reveal its colour.

Painting a cell that another patch already owns on the same layer is refused with a message naming the patch that owns it, rather than silently creating an overlap the validator would reject later.

Level Storage

Levels are ScriptableObjects in Assets/YarnBounce/Resources/Levels/, named YarnLevel_001.asset, YarnLevel_002.asset and so on, loaded at runtime through Resources. Pressing Save All renumbers the assets on disk to match the order in the list, so the campaign's order is the file numbering. The catalogue asset beside them is rewritten from that result.

There is deliberately no "generate the whole campaign" button in this window. Bulk creation lives in the Auto Level Generator, behind its own confirmation dialog.

Automatic Level Generator

Batch-creates levels. Every setting is a min/max range and each level rolls its own value inside those bounds, which is what makes one press produce a varied campaign rather than N copies of the same board.

Opening the Tool

In the Unity menu bar, go to Tools › Yarn Bounce › Auto Level Generator.

Settings

SettingDescription
Levels to generateHow many levels this run produces.
Colours (Min/Max)Palette colours per level. More colours means more dispenser reading, which is the real skill.
Grid Width / Height (Min/Max)Playable board size in cells.
Layers (Min/Max)How many stacked layers the picture peels through.
Patch Cells (Min/Max)Size of each polyomino patch. Smaller patches pack more colours into the same area.
Mystery Patches (Min/Max)How many patches start hidden.
Tube Capacity (Min/Max)How many spools a dispenser holds.
Board Fill % (Min/Max)How much of the grid height the picture occupies.
Mirror Symmetry % (Min/Max)Chance a board is mirrored left/right. Symmetry reads as "composed".
Walls % (Min/Max)Share of the grid painted as walls — cells no patch may occupy. Rises with difficulty.
Latched Patches % (Min/Max)Share of patches that ship latched. Rises with difficulty, and every level that latches also grants the UNPICK that answers it. See Level Variation.
Difficulty CurveHow fast the ramp climbs across the run. 1.0 is linear; the default 0.4 climbs faster early, because a linear ramp spends most of a long campaign being too easy.
SeedSeeds the whole run. The same seed with the same settings and the same included themes reproduces the same campaign — which is how you get back a set you liked after pressing Generate again. Randomise draws a new one.
ModeAppend adds to the end of the campaign. Replace deletes every existing level first, and asks you to confirm with the real counts before it does.

The line above the green Generate Levels button always names both numbers — how many levels this run writes, and how many are on disk right now — so you can see whether you are about to append or to destroy before you press it.

How It Works

  1. Themes are the sources. Every machine theme in Assets/YarnBounce/Settings/ is listed with a colour swatch and an include toggle, so you can see what will be used and exclude individual themes before pressing anything. Generated levels take a theme in turn.
  2. Each level rolls its own settings inside your min/max ranges.
  3. The board is generated, and its dispenser supply is balanced against patch demand.
  4. It is then verified — structure first, then the solver. A board that cannot be cleared is re-rolled, and after enough failures it falls back to a guaranteed-clearable board and says so in the run report. The re-rolls are drawn from the run seed, so the whole run stays reproducible.
  5. Duplicates are rejected. A board whose content fingerprint already exists in the campaign is thrown away and re-rolled rather than shipped as filler.
  6. Only then is it written, and numbering is assigned on success, so a skipped level never leaves a hole in the sequence.

A run reports in the window: how many levels were written, how many were skipped and why, and how many duplicates were re-rolled. Nothing is ever saved with a warning.

Append or Replace

Choose between append mode, which adds levels after the existing ones, and replace mode, which deletes every level asset currently in the campaign first. Both ask for confirmation before doing anything. Use append to add content safely.

Power-Ups

Three power-ups ship with the game. None of them can make a board unwinnable, and an invalid use consumes nothing.

Power-UpEffect
Hole Punch yarn_hole_punchClears plugged holes out of the socket row, undoing wasted yarn.
Re-Spool yarn_respoolReshuffles dispenser contents so a new colour becomes reachable.
Unload yarn_unloadEmpties the plunger chamber, returning its spools to the dispensers.

Each shows a tutorial on first use, checks an eligibility gate, and is consumed exactly once on a valid use. Counts and tutorial state persist through the kit's save system.

Adding a Power-Up Adapter

  1. Add a power-up definition asset under Assets/YarnBounce/PowerUps/ with a new id.
  2. Register a handler for that id in YarnPowerUpAdapter, alongside the three existing ones.
  3. Return a refusal reason when the effect cannot apply — that is what stops the count from being consumed.

Level Variation

A five-hundred-level campaign needs level 400 to feel different from level 4, and that difference comes from three families, introduced one at a time. The numbers below are measured from the level assets on disk, not read off a generator setting — a generator threshold is a floor, not a promise about what was actually written.

FamilyFirst shipped levelWhat changesCounter-booster
Mystery patches Level 8
in 492 of the 500
The patch starts blacked out under a "?" and reveals its real colour only when nothing covers it. You cannot plan a volley for a colour you cannot see yet. — none needed; the reveal is free
Latched patches Level 18
in 474 of the 500
The patch is latched shut and refuses yarn until it is unpicked, so the peel order is forced rather than chosen. UNPICK, unlocked at level 4
Walls Authoring only
no shipped level uses them
Cells no patch may occupy, so the picture is cut into separate regions. Paint them with the Wall tool, or raise Walls % in the Auto Level Generator.

The counter-booster always unlocks before the mechanic it answers. UNPICK is available from level 4 and the first latched patch appears at level 18. If you move the latch ramp earlier — by regenerating with a higher Latched Patches % at low difficulty, or by painting a latch into an early level by hand — move UNPICK's unlock with it. A latched patch on a level that grants no UNPICK has no counter-move, and the Manual Level Editor refuses to validate it.

How the ramp is produced

The Auto Level Generator lerps every min/max pair across the run, shaped by Difficulty Curve (default 0.4, deliberately sub-linear — a linear ramp spends most of a long campaign being too easy). Mystery Patches and Latched Patches % are the two ramps that produce the families above; both start at zero, which is why the opening levels are plain.

The first eight levels are a stated table, not a curve. A level's size is a product — region width × region height — so nudging the ranges lands the total wherever the product happens to fall, which is how a campaign ends up with a tutorial the same size as level 300. The shipped campaign states those eight sizes outright and the rest of the run ramps from there. If you regenerate, the opening is regenerated from the same table.

Because the ramp is a probability and not a schedule, the first level a family actually appears on is whatever the generator wrote. After regenerating, re-measure it rather than quoting the setting — and re-check the unlock levels of the boosters that answer it.

Layers

Patches carry a layer (1–4) and a higher layer physically covers a lower one, so a layered picture has to be peeled top-down. Every level in the shipped campaign is single-layer; the field is there for you. Set it in the Manual Level Editor's Selected Patch panel, and remember that a covered patch cannot be sewn — the solver will reject a board whose lower layers can never be reached.

Customization Guide

Day Two: the first things to change

  1. Identity — product name, company and bundle id in Player Settings.
  2. Colours — edit YarnPalette_Main in Assets/YarnBounce/Settings/. Every level indexes into it, so one edit repaints the whole campaign.
  3. Machine look — duplicate a YarnTheme_* asset, change its colours, and it appears in the Auto Level Generator's source list automatically.
  4. Levels — generate a fresh campaign, or curate the shipped one.
  5. Backend — work through the kit sections below for economy, ads, IAP and LiveOps.

Adding a Level

  1. Open Tools › Yarn Bounce › Manual Level Editor.
  2. Select a level close to what you want and press Duplicate.
  3. Paint the patches, set colours and layers, press Auto-Balance Supply.
  4. Press Validate This Level until it reports valid and solvable.
  5. Press Save All.

Adjusting Difficulty

Changing Audio

Sound is played through the kit's audio engine from a single sound bank asset. Swap a clip in the bank and every cue that uses it changes; see Audio Engine.

Level Format

A level is a YarnLevelAsset ScriptableObject. The fields that matter:

levelLabel "Level 12" gridSize (6, 8) playable grid in cells, origin bottom-left boardOffset (0.24, -0.38) shifts the board inside the cabinet shapes[] the picture, one entry per patch label "Patch 3" layer 1 1 = bottom of the stack colorIndex 2 index into YarnPalette_Main mystery false starts blacked out with "?" marks cells[] [(2,3), (3,3)] grid cells this patch covers tubeCapacity 12 spools per dispenser tubes[] element 0 is the BOTTOM of the tube spools[] [2, 2, 0, 1] palette indices launcherCapacity 6 plunger chamber size (single-colour) guardImpossibleTaps true recycleUnmatchedSpools true cabinetAccentBlend 0..1 0 keeps the painted cabinet, 1 recolours it paletteOverride / themeOverride optional per-level look

Supply must exactly match demand: the total spools across all tubes must equal the total patch cells on the board, per colour. Auto-Balance Supply in the Manual Level Editor enforces this for you.

Yarn Bounce — Common Issues

IssueSolution
No levels load, or only one level appearsCheck that level assets exist in Assets/YarnBounce/Resources/Levels/ alongside the catalogue asset. Use the Auto Level Generator to create more.
Pink / magenta machineThe project must use URP with a URP asset assigned in Project Settings › Graphics. Yarn Bounce ships URP shaders.
Text is missing or shows boxesImport TMP Essential Resources: Window › TextMeshPro › Import TMP Essential Resources.
Manual Level Editor shows an empty listPress Reload from Disk, and confirm the catalogue asset exists in Resources/Levels/.
Auto Level Generator lists no themesIt scans Assets/YarnBounce/Settings/ for machine theme assets. Press Refresh after adding one.
A generated level was skippedThe solver could not clear it within the attempt budget. Widen the ranges — more colours with very small patches is the usual cause.
Level says supply does not match demandPress Auto-Balance Supply in the Manual Level Editor.
Support

Support

Stuck on something this manual doesn’t cover? Reach out — real answers from the developer, usually within two business days.

To get the fastest turnaround, include:

Questions about the menu, ads, in-app purchases, boosters, daily rewards or any other backend system belong in the HyperCasual LiveOps Kit manual, which ships alongside this one.