Yafie logo

case.study // focuspop

Pop distractions, grow your focus.

A SwiftUI bubble-popping game built for short focus sessions.

FocusPop is a mobile game project designed around quick, lightweight focus sessions. Players enter their name, choose a gameplay mode, pop bubbles before the timer ends, and review their final score, accuracy, duration, and leaderboard result.

Role: SwiftUI Game DeveloperPlatform: iOSFocus: Gameplay Logic - MVVM - TestingType: Mobile Game Case Study

game.preview

SwiftUI focus session game

iOS
FocusPop game preview

00 // project.overview

What FocusPop is.

FocusPop is a SwiftUI bubble-popping game where users play short timed sessions and pop bubbles to build a score. The game includes two modes, colour-weighted scoring, combo rewards, pause/resume behaviour, result summaries, and a local high-score leaderboard.

Goal

Make a lightweight focus-themed game that feels simple, polished, and replayable.

Gameplay

Players pop bubbles before the timer ends, with different colours contributing different score values.

Product feel

The interface uses soft visuals, rounded cards, and playful feedback to make the game feel calm and friendly.

Engineering focus

The project focuses on testable game logic, MVVM state management, local persistence, and reliable UI flows.

01 // gameplay.flow

How the game works.

A simple loop from setup to score review.

active.step

Enter player name

The game starts by asking who is focusing today, so scores can be saved against a local player name.

02 // game.modes

Two modes of gameplay.

Normal Mode keeps the experience calm, while Moving Mode adds more challenge.

mode.01

Normal Mode

  • Calm classic gameplay
  • Bubbles stay more predictable
  • Good for a simple focus session
  • Lower movement complexity

mode.02

Moving Mode

  • More lively challenge
  • Bubbles drift upward with light horizontal movement
  • Requires faster attention and reaction
  • Adds replay variety

The two modes help the game feel flexible without adding unnecessary complexity.

03 // technical.build

How it was built.

FocusPop uses a simple but testable SwiftUI architecture.

Architecture

  • MVVM
  • GameViewModel as the source of truth for game state
  • GameState controls timer, bubble refresh, scoring, and session flow

UI

  • SwiftUI screens
  • GeometryReader-driven play area sizing
  • Responsive bubble placement
  • Soft mobile interface

State & persistence

  • Combine / ObservableObject / @Published
  • UserDefaults / @AppStorage for settings
  • JSON-based local saved scores
  • ScoreStorage isolates high-score persistence

Gameplay logic

  • BubbleGenerator handles placement
  • Overlap avoidance
  • Capped placement attempts for predictable generation
  • Weighted bubble colours
  • Combo multiplier for consecutive same-colour pops

04 // testing.quality

Testing and reliability.

The project was structured so gameplay logic could be tested separately from the UI.

test.01

Unit testing

XCTest coverage for core gameplay logic.

  • Scoring behaviour
  • Combo logic
  • Timer tick behaviour
  • Settings clamping and persistence
  • Bubble generation constraints

test.02

UI testing

End-to-end gameplay flows with stable accessibility identifiers.

  • Start session
  • Pause/resume
  • Leave confirmation
  • Result screen

Keeping gameplay logic out of the views made the project easier to test, debug, and iterate.

05 // feedback.signal

What others said.

Peer feedback screenshot for FocusPop

06 // reflection

What I learned.

State management matters

Gameplay feels simple to users, but the timer, bubbles, score, pause state, and results need a clear source of truth.

Testable logic improves confidence

Separating gameplay logic from views made scoring, combo, and generation behaviour easier to verify.

Small UI details affect feel

Soft visuals, clear mode choices, and result feedback helped the game feel more polished.

Scope control matters

Keeping the game focused on two modes made the experience easier to build, test, and explain.

FocusPop helped me practise building a polished iOS experience where product feel, state management, gameplay rules, persistence, and testing all work together. The project strengthened how I think about small interactive systems and how to make playful interfaces reliable.

final.thought

A small game with clear engineering decisions.

FocusPop shows how simple gameplay can still involve thoughtful state management, testable logic, persistence, and UI polish.