Docs

Drift

Install and make Drift yours, the arcade game in SwiftUI + Metal. Version 1.0.0.

A top-down snow rally at blue hour: press a side to slide, flick between sides, and chase your ghost through sixty stages. 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 SwiftPieces 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, Drift/.

Make it yours

cd Drift
scripts/setup.sh --name YourGame --bundle-id com.you.yourgame

The script renames the target, scheme and bundle ids, rewrites the StoreKit product ids and runs tuist generate. To keep the name Drift 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: 3 leaderboards, 20 achievements
  • Shop: Stud packs, Rally pass, Livery pack
  • Built on: GameCore, Feel, GameServices, Shaders, GameUI
  • Presets: bluehour, lamplight, whiteout
  • Swift: 9,057 lines in 77 files

Controls

InputWhat it does
Press left or right halfThe car turns that way and starts to slide
Keep holdingThe slide deepens over half a second
Let goThe tyres grip and the car straightens
Short press, then the other side within 0.3 sScandinavian flick: a sharper swing and +1 multiplier
Arrow keys or A / DThe same, on a keyboard

Rebrand options

OptionWhat it sets
--nameTarget, scheme and product name
--bundle-idBundle id. Modules, the widget, the App Group (group.<bundle-id>) and tests derive theirs from it
--display-nameThe name under the icon
--teamYour team id. Required for devices, Game Center, iCloud and the widget's App Group
--product-prefixApp Store Connect product ids. Defaults to the bundle id

The values live in Tuist/ProjectDescriptionHelpers/AppConfig.swift. Game Center ids are listed in Configuration/GameCenter.json (three leaderboards, twenty achievements); create them under your app in App Store Connect. Products are in Configuration/Products.storekit, which the scheme uses for local purchases.

Structure

App/                  @main, the root stage (Metal world + phase layer), the tab hub, deep links
Features/Play         Start lights, the play HUD (clock, points, pacenote tape, splits) and pause
Features/Results      The timecard: time, splits, bars, points, studs and missions, then the CTAs
Features/Home         Home over the attract car, the next stage, Daily and Night Run, the gift sheet
Features/Stages       Six regions of ten stages, with bars, best times and what opens next
Features/Garage       Cars, liveries, lamp pods and tyres, tried on the parked car as you touch them
Features/Missions     Rally licence grades and the mission board
Features/Shop         Studs, the Rally Pass and the livery pack
Features/Settings     Sound, haptics, co-driver tick, motion, contrast, colour vision, assist, ghosts
Modules/GameCore      Fixed-step clock, seeded RNG, daily seed, saves, event ring, synth (no game types)
Modules/GameDesign    GameTheme tokens, variants, the decal finish shader and the component kit
Modules/DriftKit      The simulation: car, road, ice, pacenotes, scoring, stages, missions, profile
Modules/DriftRender   MTKView renderer: track map, world, uber-post, side input, quality tiers
Modules/Feel          Sound bank (engine, hiss, wind, cues), audio engine, haptic patterns
Modules/GameServices  Game Center, StoreKit 2, iCloud sync, reminders
Modules/Session       GameSession (phases and low-frequency state) and the JuiceDirector
Widget/               The Daily Stage widget. Shared/ holds what it shares with the app
Design/StyleSpec.md   The art direction: tone, shapes, palette, light, type, motion, sound
Tests/                Swift Testing: simulation, stages, balance and meta

How it runs

  • The simulation (World.step) is plain Swift at a fixed 120 Hz with a seeded RNG; the renderer interpolates. SwiftUI only sees GameSession, which publishes the HUD when a visible value changes, never per frame.
  • The road is a sum of three sines, the same formula in Swift and in the shader, so the world is drawn from the stage's numbers with no meshes.
  • The sim emits DriftEvents; the JuiceDirector turns each into its feedback stack (thrown snow, shake, flash, sound, haptic, HUD pop), scaled by how rare the event is.
  • Tyre grooves are stamped into a half-float track map that scrolls with the camera, so the snow remembers where you have been.
  • The renderer is mounted once. Pausing flips the phase and returns through the start lights; it never tears down.
  • The look is a theme: change GameTheme.drift (colours, type, radii, motion, sound) and both the SwiftUI screens and the Metal uniforms follow.

Tuning and the difficulty curve are documented in BALANCE.md.

Licenses

Barlow Condensed is under the SIL Open Font License 1.1 (Licenses/). Everything else in the project is yours to ship with your game. See ASSET_MANIFEST.md.

Changelog

1.0.0

2026-10-30

  • First release: a top-down snow rally at blue hour, with SwiftUI meta screens over a Metal world.
  • Side controls: press a side to slide that way, hold to slide deeper, let go to grip, and flick from side to side for a Scandinavian flick.
  • Sixty fixed stages across six regions (forest, frozen lakes, fell, night, storm and the Midwinter Final), with pacenotes, ice, banks and three bars per stage.
  • Daily Stage: one seeded stage a day for everyone, with your best driven back as a ghost, live splits, a streak and a Home Screen widget.
  • Night Run: an endless night road where checkpoints add time to the clock.
  • Garage with six cars, eleven liveries, four lamp pods and three tyres; missions with rally licence grades, a seven-day gift sheet and twenty achievements.
  • StoreKit 2 shop: stud packs, the Rally Pass and the livery pack, with restore and a local StoreKit configuration.
  • Game Center leaderboards and achievements, iCloud save sync, Game Mode, 120 Hz, thermal tiers, Reduce Motion, contrast, colour-vision and steering-assist options.
  • Every sound synthesised on the device; every surface drawn in shaders.