nemr.app

Indie GamesEngineering

How I Built Pompa the Chinchompa, a Rolling Puzzle Game for iPhone

· 10 min read · by Elias Nemr

How I built Pompa the Chinchompa, a rolling puzzle for iPhone: the solver behind every level, the loop bug I fixed, AI-made animation and App Store lessons.

Pompa the Chinchompa is a small rolling puzzle for iPhone. You play a round, fluffy chinchompa who can't stop rolling: drag across the board to aim, let go, and Pompa slides until something blocks the way. Get to the burrow in as few rolls as you can, and collect the seeds for extra stars.

This is the story of how it was made: the rules engine, how the levels were found, a bug that taught me to write things down, how Pompa got his personality, and what the App Store taught me. It's also a record of working with an AI coding assistant on a real project. The repository's first commit is dated 15 October 2026, and every commit is co-authored by Claude. The design started as a design canvas made with Claude, and the code was written with Claude Code.

The idea

Sliding puzzles are a classic: you don't walk, you slide, and the fun is in planning where you'll stop. Pompa wraps that idea in a small, calm game with a round, friendly character. The core rules are tiny:

  • You drag to aim and release to roll. Pompa keeps rolling until a rock or the board edge stops him.
  • Arrows turn the roll, cracked ground crumbles behind you, and warp holes teleport him to their twin.
  • The goal is the burrow. Every level has par: the fewest rolls that collect every seed and reach the burrow.
  • Three stars per level: finish, collect all the seeds, and match par.

A second world, Mossy Hollow, adds switches and gates: gates start closed and block like rocks, and rolling over a switch flips every gate of its colour.

The stack, and why "boring" was the goal

Pompa is a native SwiftUI app for iOS 17 and later with no third-party dependencies, about 3,100 lines of Swift. No analytics, no ads, no accounts, no servers. Progress is saved on the device and mirrored through iCloud key-value storage so it follows a player between their own devices. That's why the App Store privacy label can honestly say Data Not Collected.

The key design decision was to keep the game rules in a pure engine with no UI in it. A level is a grid of tiles, and rolling is a function:

enum Tile: Hashable {
    case floor, rock, burrow, cracked
    case arrow(Direction)
    case portal(Int)
    case switchTile(Int)   // flips every gate of the same colour
    case gate(Int)         // blocks like a rock until its switch opens it
}

static func roll(_ level: Level, from: Cell, direction: Direction,
                 broken: Set<Cell> = [], open: Set<Int> = []) -> RollResult

Because Engine.roll is a pure function, everything else can lean on it: the SwiftUI views just animate the steps it returns, the solver calls it millions of times, and the tests can check every tile rule without launching a simulator. By the end there were over 60 automated tests.

Par comes from a solver, not from me

The most useful decision was never typing a par by hand. The engine has a solve function, and par is whatever the solver finds: the fewest rolls that collect every seed and reach the burrow. That guarantees two things: every level is solvable, and three stars is always reachable, so the game is never lying to the player.

Finding levels with a search, then checking them

I didn't draw 44 levels by hand. Boards are written as small ASCII grids (. floor, # rock, S start, B burrow, * seed, ^v<> arrows, and so on), and a search script generates candidates from a spec: board size, how many rocks, arrows, cracks, gates, and the par range I wanted. The rules are mirrored in the script, and it only keeps boards that pass hard checks:

  • Solvable with every seed collected.
  • Every mechanic on the board must matter: arrows, cracks and warp holes have to shorten the shortest solution, and in Mossy Hollow the shortest solution must pass through an opened gate.
  • Par never drops from one level to the next in a world, so difficulty ramps up, and boards are at most 8 × 8.
  • A new idea arrives in its own level, with a tip, before it's combined with others.

The result is 20 free levels in Dusty Dunes and 24 in Mossy Hollow. One honest limit of this approach: a search finds solvable boards, not necessarily good ones. Some boards feel arbitrary, so a human still has to play them and swap the dull ones out.

The bug that taught me to write a skill

Early on, Dusty Dunes level 14 had a right-arrow and a left-arrow facing each other one tile apart. A roll that entered the gap bounced between them until a 120-step safety cap stopped it, so the player sat through ten seconds of Pompa oscillating and felt stuck. My search only checked "is it solvable?", so it had missed it. Four levels across the two worlds had reachable loops.

The fix had two parts. First, the engine now tracks its full state (position, heading, which gates are open, which tiles have crumbled) and stops a roll the moment that state repeats. Pompa gets a dizzy wiggle and a short pause instead of ten seconds of nothing. Second, the search and the test suite now check that no roll reachable from the start can loop, and the four bad levels were replaced with loop-free boards of the same par.

Then I did something that I'd recommend to anyone working with an AI assistant: I wrote the lesson down as a project skill, a short document the assistant reads whenever it touches levels or engine rules. It lists the hard rules, the commands to run, and everything else that must be updated when a level changes (expected par arrays in the tests, translations of level names in all 11 languages, regenerated screenshots, a new build number). The mistake is now impossible to repeat by accident, for me or for the assistant.

Controls: from buttons to drag-to-aim

The first version had four arrow buttons. On the same day they were replaced with drag-to-aim, which suits a game about momentum much better: a fading trail follows your finger, Pompa winds up against the aim, and a chevron shows the first direction. The nicest part is chained rolls: if you turn a corner without lifting your finger, the leg you just drew locks in, so "right, then down" rolls right and then down, with a little pill above the board showing the queue (up to six legs). Dragging back to the start cancels. VoiceOver users get roll left, right, up and down actions on the board instead.

Teaching without a wall of text

A rolling puzzle is easy to explain with a finger and hard to explain with words. The How to play flow uses four small guided boards. A ghost finger demonstrates each move until the player takes over (a real touch always wins), and the counter being explained (Moves, Par or Seeds) pulses. Tapping any counter in any level opens a short explanation. The tutorial boards are checked by tests too: they're solvable, the demos finish their boards, and none of it counts as progress.

Giving Pompa a personality

Pompa started as a character drawn in code: separate SwiftUI layers for tail, torso, ears, eyes, mouth and hats, with code-driven animation. It's lightweight and crisp at any size. But a character on a home screen feels more alive with real motion, so I added animation made with Higgsfield, an AI video tool, generating clips with the Seedance model. (If you want the workflow, I wrote up how to drive Higgsfield from Claude with MCP.)

The interesting engineering was turning generated video into something that sits cleanly on top of a game:

  • Transparency. Video normally has no alpha channel. The clips are cut out against white and black versions of the footage, which makes it possible to recover the transparency. The result is a transparent HEVC video, premultiplied so AVFoundation composites it correctly.
  • Seamless loops. One clip ended mid tail-swing and snapped back to its first frame. A small script now trims to the calmest late frame and cross-fades into frame zero, so the last frame matches the first.
  • Subtle idle. Looping an idle clip back to back looks frantic. Pompa now rests on frame zero and breathes slowly, and plays the clip only once every few seconds.
  • A cheer on level complete that plays once, and a fallback to the drawn Pompa if the clip can't load or when he's wearing a hat the clip doesn't have.
  • The curl. When Pompa rolls, he curls into a ball. That clip is cut into ten sprite frames, so the roll is driven by distance travelled and the curl and stand-up overlap the movement, which keeps every move as fast as before.
Ten frames of Pompa the chinchompa going from standing, to crouching, to curled into a round ball
The ten curl frames, cut from a generated clip. The roll animation plays them by distance travelled.

Because the clips are made during development and bundled as files, nothing AI-related runs inside the app. That's also how I described it to App Review, which brings me to shipping.

Shipping: where the real friction was

  • Localisation from day one. The interface and the store listing are translated into 11 languages (English, Spanish, French, German, Portuguese, Italian, Japanese, Korean, Simplified and Traditional Chinese, Russian) using a String Catalog. Every new level name or tip needs all 11 translations, which is exactly the kind of chore the project skill now spells out.
  • Screenshots by script. Debug-only launch arguments put the game in any state (open level 9, autoplay the shortest solution, hold a drag in progress, seed some progress), and a script captures five or six shots in all 11 languages. It's also how the pictures in this post were made.
  • Size rules. App Store Connect rejected the first screenshot set for the medium-display slot because the dimensions were invalid, so I regenerated the set at the right resolution. It also rejects images with an alpha channel, so a tiny script flattens every PNG losslessly.
  • Purchases. StoreKit 2 handles one non-consumable world (Mossy Hollow), three hats and two hint packs, with restore purchases. Hint packs are credited exactly once, keyed by transaction ID, and there's a test for it.
  • App Review. The first review came back asking for information (Guideline 2.1). My reply covered a screen recording of the app, a plain description of its purpose and audience, how to reach the paid content, and the services used: only Apple frameworks, no third-party SDKs, and a note that the animations were made with an AI tool during development. Clear, complete answers beat clever ones.

What I'd tell someone building their first game

  • Put the rules in a pure, testable core and keep the UI thin. Everything else gets easier.
  • Let a solver, not your intuition, decide the numbers (par, difficulty ramp) and make "impossible to get stuck" a tested property.
  • Search finds valid content; humans make it good. Budget time for playtesting.
  • Write each hard-won lesson down where your tools (and future you) will read it.
  • Teach by showing. A ghost finger beats three paragraphs.
  • Generated video needs engineering (alpha, loops, restraint) before it feels like part of the game.
  • Automate the boring release work: screenshots, translations, size checks.

Try it

I also made Club Kitten, a cozy cat-hatching game, and I wrote the general playbook for building an iOS game with Claude, plus a guide to building iOS and Android apps. If you're planning a game or an app and want a second pair of hands, say hello.

Elias Nemr is a software engineer who has built and shipped products across Blockchain, Finance, E-Commerce, AI, Energy and Indie Games. More about him →

Found this useful? Buy me a coffee

Keep reading