Designing iPad games a cat can't quit: a two-finger exit and a locked results screen
Cats are the only players who will never read the instructions. I build an iPhone and iPad app called Cat Translator: Games for Cats. Part of it is six small touch games for cats: a koi pond, a mouse, a feather wand, a laser dot, bugs and birds. You put the device on the floor, the cat paws at the screen, every tap near the prey counts as a catch, and a round lasts one or two minutes. The hard part was not drawing fish. It was this: the player is actively trying to touch everything on the screen, including every button you put there. A normal game assumes the player wants to stay in the game and will press "Quit" on purpose. A cat presses "Quit" because it is near the fish. Here is what I ended up with, and why. 1. The exit is a gesture a paw can't make Any visible button is a target. So the only way out of a running game is a gesture that is easy for a human hand and almost impossible for a paw: two fingers, held together in one top corner, for one full second. A paw is roughly one contact point. Cats also slap and lift; they rarely rest two pads in the same small zone for a second. People do this without thinking. The logic is a small pure struct that the scene feeds with the active touches on every touch change, plus a tick per frame. It never consumes touches, it only watches them, so a touch in the corner can still count as a catch. struct TwoFingerHoldExit { enum Corner { case topLeading, topTrailing } static let holdDuration: TimeInterval = 1 static let requiredTouches = 2 static let zoneSize = CGSize(width: 150, height: 150) private(set) var holdStart: TimeInterval? private(set) var corner: Corner? private(set) var progress: Double = 0 private(set) var hasFired = false static func zones(in bounds: CGRect) -> [(Corner, CGRect)] { let w = min(zoneSize.width, bounds.width / 2) let h = min(zoneSize.height, bounds.height / 2) return [ (.topLeading, CGRect(x: bounds.minX, y: bounds.minY, width: w, height: h)), (.topTrailing, CGRect(x: bounds.maxX - w, y: bounds.minY, width: w, height: h)), ] } // Active touches (began or moved) in view coordinates. mutating func update(touches points: [CGPoint], in bounds: CGRect, at time: TimeInterval) { guard !hasFired else { return } let held = Self.zones(in: bounds).first { _, zone in points.filter { zone.contains($0) }.count >= Self.requiredTouches }?.0 if let held { if corner != held || holdStart == nil { corner = held; holdStart = time; progress = 0 } } else { cancel() } } // Called every frame. Returns true exactly once when the hold completes. mutating func tick(at time: TimeInterval) -> Bool { guard !hasFired, let holdStart else { return false } progress = min(1, max(0, (time - holdStart) / Self.holdDuration)) guard progress >= 1 else { return false } hasFired = true return true } mutating func cancel() { holdStart = nil; corner = nil; progress = 0 } } progress drives a small ring that fills in the held corner, so the human gets feedback and the cat gets nothing interesting to chase. A few details that mattered: 150 √ó 150 pt zones. Big enough for two fingertips on an iPhone, small enough that a cat rarely lands two paws in one corner at once. Moving to the other corner restarts the hold. Lifting one finger empties the ring. Pure logic, no UIKit. It takes points and timestamps, so it is trivial to unit test: two touches in a zone for 0.99 s must not fire, 1.0 s must fire once. 2. SpriteView wasn't enough SwiftUI's SpriteView is lovely for most SpriteKit work, but I needed two things it didn't give me: multi-touch for the exit gesture, and changing the frame-rate target at runtime (more on that below). So the scene lives in a small UIViewRepresentable wrapping an SKView with isMultipleTouchEnabled = true. 3. Keep the system from helping the cat A cat's paw near a screen edge is a perfect accidental swipe: home indicator, notification center, Control Center. Two modifiers on the game screen take care of most of that: .persistentSystemOverlays(.hidden) .defersSystemGestures(on: .all) With deferral, the first swipe from an edge only reveals the indicator; a deliberate second swipe still works, so the owner is never trapped. While a round runs, the idle timer is disabled so the screen doesn't dim mid-hunt, and the previous value is restored when the game closes. 4. The results screen is the most dangerous screen A 60 or 120 second round often ends while the cat is still pawing, and a normal results card ("12 catches! Play again / Done / Share") puts its buttons exactly where the paws are landing. Left as-is, the cat would be the one choosing "Play again" or "Share". So the round-end card arrives locked: the scene keeps running blurred behind it, the buttons are dimmed and ignore touches, and the only way to unlock it is the same two-finger hold. One gesture to learn, everywhere. Accessibility needed an exception. People using VoiceOver or Switch Control can't do a timed two-finger hold, so for them the card unlocks immediately. A rule that protects against a cat should not lock out a person. 5. Short rounds, quiet defaults Rounds are 60 or 120 seconds. Screen play should be a short burst, ideally followed by a real toy, so the cat finishes on a catch it can feel. Haptics are off by default. A buzz on every catch is fun for a human holding the phone and pointless or startling for a cat on the floor. A thermal governor lowers the frame-rate target when the device warms up. A game a cat plays for two minutes on a carpet shouldn't cook an old iPad. 6. Counting what the cat did, without a scoreboard Each round still records catches, best streak (catches in a row without a clear miss far from every prey; near misses don't break it), time to first catch and how the round ended: completed, owner exit, or app backgrounded. That last one is the signal I watch most: if "owner exit" climbs for one game while "completed" drops, the game is probably boring or confusing for cats. What I'd tell anyone building for a non-human player Assume every pixel will be touched. Buttons are targets. Make the human control a gesture, not a place. Keep that gesture identical everywhere, including on results and pause screens. Give the system as little chance as possible to help the player leave, but never trap the human. Write the gesture as pure logic you can test with fake touches and fake clocks. If you want to see it in action, the games are in Cat Translator: Games for Cats on iPhone and iPad. There is also a free in-browser version of the laser game at catstranslator.com/games-for-cats if you want to test your own cat first.
This is a summary aggregated from Dev.to. Read the complete article on the original site:
Read full article at Dev.to