Docs

Advent · Day 4

This one opens on December 4.

Every door opens at midnight Pacific.

See the calendar

TangleGames

Install and make Tangle yours, the puzzle game in SwiftUI + Metal. Version 1.0.0.

An untangling puzzle: drag the pins of a scrambled knot until no strand crosses another, in three skins that each change the whole game. This guide takes you from download to a running game under your own name. It covers version 1.0.0. See the screens on its game page.

Requirements

  • Xcode 26 and an iOS 17.0 or later deployment target
  • Tuist 4 (brew install tuist)
  • An Apple Developer team for devices, Game Center, iCloud and the widget. The simulator runs without one.

Install

Download

Included with Games. Not signed in? The button takes you to sign in or create an account, then starts the download when you're back. Unzip the archive; it contains one folder, Tangle/.

Make it yours

cd Tangle
scripts/setup.sh --name YourGame --bundle-id com.you.yourgame --preset planisphere

The script renames the target, scheme and bundle ids, rewrites the StoreKit product ids, sets the starting preset and runs tuist generate. To keep the name Tangle for now, run tuist generate instead.

Run it

Open YourGame.xcworkspace, choose an iPhone simulator and run the YourGame scheme. The scheme uses Configuration/Products.storekit, so the shop works before App Store Connect is set up.

What's in the project

  • Content: 60 levels
  • Game Center: 2 leaderboards, 10 achievements
  • Shop: Hint packs, Tip jar
  • Built on: GameCore, Feel, GameServices, GameUI
  • Presets: pattern, planisphere, corkboard
  • Swift: 3,527 lines in 34 files

How Tangle plays

  1. Drag any pin. Strands follow it, and every crossing is marked live: a red notch on Pattern, a red ring on Planisphere, a marker cross on Corkboard.
  2. Putting a pin down counts as one move. A pin put back where it was doesn't count.
  3. The knot is solved when nothing crosses and no pin rests on a strand it isn't part of.
  4. Finish at or under par for three stars. Undo takes back a move but keeps the count; a hint sends the most tangled pin to its place in the untangled layout and costs a star.

Knot n has 6 to 26 pins (Catalog.pins(for:)). The next knot opens when you solve one, and each chapter opens with half the stars of the one before. Today's knot (Daily) has 14 to 18 pins and builds a streak.

The three skins

Each skin has its own title, play and win screen, not just its own colours. All three are free and switch live in Settings.

SkinTitlePlayWin
Pattern (default)A pattern envelope with today's knot on the tissue and a spec tableTissue with a tape-measure ruler down the left that counts moves, each strand in its own dash like pattern size lines, glass-head pinsThe piece, cut out, with scissors
PlanisphereA round star chart with the title on the dial's rimThe knot is a constellation inside the dial; moves, par and crossings run round the rim; round Undo and Hint buttonsNight falls and the constellation is drawn in gold and added to your atlas
CorkboardAn index card taped over a board of notes and stringNotes pinned to cork, the score on a ruled index card, Undo and Hint as sticky notesA SOLVED stamp on the card

What's inside

FolderWhat
Modules/GameCoreGame-agnostic pieces: SplitMix64 and the day clock.
Modules/TangleKitThe game in plain Swift (Foundation only): geometry (crossings and touches), the knot maker (well-spaced pins joined shortest first without crossings, then scrambled round a circle), the 60-knot catalog and today's knot, the round (drag, drop, undo, hints, stars), the save with merge, Game Center goals, product ids and sound and haptic cues.
Modules/TangleDesignThe three skins' colours and fonts (TangleTheme), pattern dashes, and the buttons each skin draws its own way.
Modules/TangleFeelStringSynth (plucked strings by Karplus–Strong, wooden ticks and a small room, all synthesized) and the AVAudioEngine and Core Haptics players.
Modules/GameServicesGame-agnostic Game Center, the iCloud key-value mirror and the StoreKit 2 storefront.
Modules/TangleUIThe session and every screen: the board and its three painters, each skin's title, play and win screens, the knots list, settings and the shop.
App, WidgetApp entry and service wiring; a Home Screen widget with today's knot and your streak.
Tests, UITestsXCTest for the catalog (every knot solvable, tangled at the start, pins apart), geometry, rounds, hints, saves, merges and the synth; XCUITest plays a knot in every skin and visits the menus.

Rebrand options

  • Look: every colour and font is in TangleTheme (Modules/TangleDesign/Sources/Theme.swift). The painters are in Modules/TangleUI/Sources/Board.swift and each skin's screens in its own file.
  • Knots: sizes, chapters and the daily knot are in Catalog.swift; par and stars in Knot.swift and Round.swift. Numbers are in BALANCE.md.
  • Store: product ids follow the prefix from setup.sh (Products).
  • Game Center: GAMECENTER.md lists every id to create.

Tests

TangleTests checks every shipped knot (solution flat, start tangled, pins on the board and far enough apart to grab), crossings and touches, drag and drop, undo, hints that always finish, unlocks, streaks, merges and that every sound renders. TangleUITests launches with -SPFreshSave -SPNoGameCenter -SPDay 14 and plays. The pure modules also build on Linux with SwiftPM.

Launch arguments for screenshots: -SPScreen title|knots|play|win, -SPSkin pattern|planisphere|corkboard, -SPDay <n>, -SPSkipOnboarding, -SPNoGameCenter.

Accessibility

Crossings are marked by shape as well as colour (notches, rings, crosses), and the crossing count is always written out. The board has a VoiceOver summary with the number of crossings, and every control is labelled. Type scales with Dynamic Type.

Changelog

1.0.0

2026-12-04

  • An untangling puzzle: drag the pins until no strand crosses another. Every knot is built from a flat layout, so it can always be solved.
  • 60 knots in three chapters (Loose ends, Snarls, Hard knots), growing from 6 pins to 26, with stars for finishing at or under par.
  • Today's knot: the same for everyone each day, with a streak and a Home Screen widget.
  • Three skins, all free and switched live, each with its own title, play and win screens: Pattern (glass-head pins on sewing tissue, a ruler that counts moves, red notches at crossings), Planisphere (stars on a round sky chart with the score on the dial's rim) and Corkboard (notes and string on cork, an index card for the score, sticky-note buttons).
  • Undo, restart and hints that put the most tangled pin back where it belongs; hint packs and a tip jar on StoreKit 2.
  • Plucked-string sounds synthesized on the device that climb a scale as crossings come free, and Core Haptics.
  • Game Center: 10 achievements and 2 leaderboards. iCloud keeps progress in step across devices.