# theiphoneos1project/brickbreak architecture

> Architecture diagram of the GitHub repository theiphoneos1project/brickbreak, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/theiphoneos1project/brickbreak
- Repository: https://github.com/theiphoneos1project/brickbreak

## Overview

#### Purpose and entry points

BrickBreak is a small native Objective-C brick-breaking game targeting iPhone OS 1.x and the fragile Objective-C runtime. Process startup is `main.m`, which launches the application class declared in `include/BrickBreakApp.h` and implemented by `src/BrickBreakApp.m`.

#### Application lifecycle and UI host

`BrickBreakApp` is the application-level controller. It owns startup/lifecycle integration with the early iPhone OS UIKit environment and establishes the game UI hierarchy. Its implementation is the boundary between platform callbacks and game-specific views.

Paths:
- `main.m`
- `include/BrickBreakApp.h`
- `src/BrickBreakApp.m`

#### Game scene coordinator

`BBGameContentView` is the primary gameplay container and likely the central update/control point: it composes the paddle, ball, and brick/block views, handles touch input, and coordinates movement, collision, scoring/reset, and rendering within one UIKit view.

Paths:
- `include/BBGameContentView.h`
- `src/BBGameContentView.m`

#### Paddle input boundary

`BBPaddleView` represents the player-controlled paddle. Input from the device reaches the game through the UIKit view/touch system, then is translated into paddle positioning constrained by the game scene. The paddle’s geometry is also a collision boundary for the ball.

Paths:
- `include/BBPaddleView.h`
- `src/BBPaddleView.m`

#### Ball simulation and collision flow

`BBBallView` represents the moving ball. Its update flow is expected to advance position, reflect against scene edges and the paddle, and notify or be evaluated by `BBGameContentView` for block impacts and loss/reset conditions. It is the main continuous-motion component.

Paths:
- `include/BBBallView.h`
- `src/BBBallView.m`

#### Bricks and destruction state

`BBBlockView` models an individual breakable brick. The game coordinator creates and lays out a block field, while ball/block collision removes, hides, or otherwise changes blocks. This separates static brick presentation from scene-level progression logic.

Paths:
- `include/BBBlockView.h`
- `src/BBBlockView.m`

#### Runtime, packaging, and delivery

The project is compiled with `clang` against an unofficial iPhone OS 1 SDK and requires a patched linker supporting the Objective-C fragile runtime. `Makefile` builds the application and packages a `.PXL` installer; package metadata is in `PxlPkg.plist`. Distribution targets jailbroken-era device tooling such as iBrickr rather than a web or service backend.

Paths:
- `Makefile`
- `PxlPkg.plist`
- `app/Info.plist`

Main entry points: [`src/BBGameContentView.m`](https://github.com/theiphoneos1project/brickbreak/blob/main/src/BBGameContentView.m) (BBGameContentView), [`src/BBBallView.m`](https://github.com/theiphoneos1project/brickbreak/blob/main/src/BBBallView.m) (BBBallView), [`Makefile`](https://github.com/theiphoneos1project/brickbreak/blob/main/Makefile) (Makefile), [`src/BrickBreakApp.m`](https://github.com/theiphoneos1project/brickbreak/blob/main/src/BrickBreakApp.m) (BrickBreakApp)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["iPhone App Runtime"]
  node_main["main.m<br/>process entry<br/>[main.m]"]
  node_app_header["BrickBreakApp API<br/>Objective-C header<br/>[BrickBreakApp.h]"]
  node_app["BrickBreakApp<br/>application controller<br/>[BrickBreakApp.m]"]
  node_uikit{{"Early iPhone OS UIKit<br/>platform runtime"}}
end

subgraph group_gameplay["Gameplay Scene"]
  node_scene_header["BBGameContentView API<br/>Objective-C header"]
  node_scene["BBGameContentView<br/>game scene coordinator"]
  node_paddle_header["BBPaddleView API<br/>Objective-C header<br/>[BBPaddleView.h]"]
  node_paddle["BBPaddleView<br/>player paddle view<br/>[BBPaddleView.m]"]
  node_ball_header["BBBallView API<br/>Objective-C header<br/>[BBBallView.h]"]
  node_ball["BBBallView<br/>ball simulation view<br/>[BBBallView.m]"]
  node_block_header["BBBlockView API<br/>Objective-C header<br/>[BBBlockView.h]"]
  node_block["BBBlockView<br/>breakable brick view<br/>[BBBlockView.m]"]
end

subgraph group_delivery["Build &amp; Delivery"]
  node_makefile["Makefile<br/>build pipeline"]
  node_app_metadata["App metadata<br/>application manifest<br/>[Info.plist]"]
  node_package_metadata["PXL package metadata<br/>package manifest<br/>[PxlPkg.plist]"]
  node_pxl["PXL installer<br/>device package"]
end

node_main -->|"launches"| node_app
node_app_header -.->|"declares"| node_app
node_uikit -->|"lifecycle callbacks"| node_app
node_app -->|"hosts"| node_scene
node_scene_header -.->|"declares"| node_scene
node_uikit -->|"touch and view runtime"| node_scene
node_scene -->|"composes and positions"| node_paddle
node_paddle_header -.->|"declares"| node_paddle
node_scene -->|"updates"| node_ball
node_ball_header -.->|"declares"| node_ball
node_scene -->|"creates and lays out"| node_block
node_block_header -.->|"declares"| node_block
node_paddle -->|"collision boundary"| node_ball
node_ball -->|"edge, loss, and block events"| node_scene
node_ball -->|"impact"| node_block
node_makefile -->|"compiles app"| node_main
node_app_metadata -->|"app bundle metadata"| node_makefile
node_package_metadata -->|"package metadata"| node_makefile
node_makefile -->|"packages"| node_pxl

click node_main "https://github.com/theiphoneos1project/brickbreak/blob/main/main.m"
click node_app_header "https://github.com/theiphoneos1project/brickbreak/blob/main/include/BrickBreakApp.h"
click node_app "https://github.com/theiphoneos1project/brickbreak/blob/main/src/BrickBreakApp.m"
click node_scene_header "https://github.com/theiphoneos1project/brickbreak/blob/main/include/BBGameContentView.h"
click node_scene "https://github.com/theiphoneos1project/brickbreak/blob/main/src/BBGameContentView.m"
click node_paddle_header "https://github.com/theiphoneos1project/brickbreak/blob/main/include/BBPaddleView.h"
click node_paddle "https://github.com/theiphoneos1project/brickbreak/blob/main/src/BBPaddleView.m"
click node_ball_header "https://github.com/theiphoneos1project/brickbreak/blob/main/include/BBBallView.h"
click node_ball "https://github.com/theiphoneos1project/brickbreak/blob/main/src/BBBallView.m"
click node_block_header "https://github.com/theiphoneos1project/brickbreak/blob/main/include/BBBlockView.h"
click node_block "https://github.com/theiphoneos1project/brickbreak/blob/main/src/BBBlockView.m"
click node_makefile "https://github.com/theiphoneos1project/brickbreak/blob/main/Makefile"
click node_app_metadata "https://github.com/theiphoneos1project/brickbreak/blob/main/app/Info.plist"
click node_package_metadata "https://github.com/theiphoneos1project/brickbreak/blob/main/PxlPkg.plist"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_app_header,node_app,node_uikit toneBlue
class node_scene_header,node_scene,node_paddle_header,node_paddle,node_ball_header,node_ball,node_block_header,node_block toneAmber
class node_makefile,node_app_metadata,node_package_metadata,node_pxl toneMint
```

## Components

### iPhone App Runtime

Native UIKit game running on early iPhone OS.

- [main.m](https://github.com/theiphoneos1project/brickbreak/blob/main/main.m): process entry · Launches the application class. · `main.m`
- [BrickBreakApp API](https://github.com/theiphoneos1project/brickbreak/blob/main/include/BrickBreakApp.h): Objective-C header · `include/BrickBreakApp.h`
- [BrickBreakApp](https://github.com/theiphoneos1project/brickbreak/blob/main/src/BrickBreakApp.m): application controller · Bridges UIKit lifecycle callbacks to the game UI. · `src/BrickBreakApp.m`
- **Early iPhone OS UIKit**: platform runtime · Supplies lifecycle and touch/view infrastructure.

### Gameplay Scene

Views and scene-level game coordination.

- [BBGameContentView API](https://github.com/theiphoneos1project/brickbreak/blob/main/include/BBGameContentView.h): Objective-C header · `include/BBGameContentView.h`
- [BBGameContentView](https://github.com/theiphoneos1project/brickbreak/blob/main/src/BBGameContentView.m): game scene coordinator · Composes gameplay views and coordinates updates, collisions, scoring, and resets. · `src/BBGameContentView.m`
- [BBPaddleView API](https://github.com/theiphoneos1project/brickbreak/blob/main/include/BBPaddleView.h): Objective-C header · `include/BBPaddleView.h`
- [BBPaddleView](https://github.com/theiphoneos1project/brickbreak/blob/main/src/BBPaddleView.m): player paddle view · Translates touch movement into constrained paddle position. · `src/BBPaddleView.m`
- [BBBallView API](https://github.com/theiphoneos1project/brickbreak/blob/main/include/BBBallView.h): Objective-C header · `include/BBBallView.h`
- [BBBallView](https://github.com/theiphoneos1project/brickbreak/blob/main/src/BBBallView.m): ball simulation view · Advances motion and reflects from scene and paddle boundaries. · `src/BBBallView.m`
- [BBBlockView API](https://github.com/theiphoneos1project/brickbreak/blob/main/include/BBBlockView.h): Objective-C header · `include/BBBlockView.h`
- [BBBlockView](https://github.com/theiphoneos1project/brickbreak/blob/main/src/BBBlockView.m): breakable brick view · Represents one destructible brick. · `src/BBBlockView.m`

### Build & Delivery

Legacy SDK build and PXL packaging.

- [Makefile](https://github.com/theiphoneos1project/brickbreak/blob/main/Makefile): build pipeline · Builds against the unofficial SDK and packages the installer. · `Makefile`
- [App metadata](https://github.com/theiphoneos1project/brickbreak/blob/main/app/Info.plist): application manifest · `app/Info.plist`
- [PXL package metadata](https://github.com/theiphoneos1project/brickbreak/blob/main/PxlPkg.plist): package manifest · `PxlPkg.plist`
- **PXL installer**: device package · Installed through jailbroken-era device tooling.

## Connections

- main.m → BrickBreakApp: launches
- BrickBreakApp API → BrickBreakApp: declares
- Early iPhone OS UIKit → BrickBreakApp: lifecycle callbacks
- BrickBreakApp → BBGameContentView: hosts
- BBGameContentView API → BBGameContentView: declares
- Early iPhone OS UIKit → BBGameContentView: touch and view runtime
- BBGameContentView → BBPaddleView: composes and positions
- BBPaddleView API → BBPaddleView: declares
- BBGameContentView → BBBallView: updates
- BBBallView API → BBBallView: declares
- BBGameContentView → BBBlockView: creates and lays out
- BBBlockView API → BBBlockView: declares
- BBPaddleView → BBBallView: collision boundary
- BBBallView → BBGameContentView: edge, loss, and block events
- BBBallView → BBBlockView: impact
- Makefile → main.m: compiles app
- App metadata → Makefile: app bundle metadata
- PXL package metadata → Makefile: package metadata
- Makefile → PXL installer: packages
