Skip to content

iOS Game SDK v0.0.1

Latest

Choose a tag to compare

@trunghieuvn trunghieuvn released this 28 Jun 18:05

Play2048 — iOS Game SDK v0.0.1

Native Swift mini-game SDKs (no WebView). Download play2048-ios-sdk-v0.0.1.zip below.

Products (one Swift Package, iOS 12+, UIKit):

  • GoBrainGamesSDK — 2048, Sudoku, Tango, Patch (Shikaku), Zip, Wend, Mend
  • BeatGameSDK — Beat music/tiles game (level + endless + tutorial + themes) + shared Protobuf entities

Depends on apple/swift-protobuf (resolved automatically). Verified building for iOS.

Quick setup

  1. Unzip into your app, e.g. YourApp/Packages/Play2048/.
  2. Xcode → File → Add Package Dependencies… → Add Local… → select the Play2048 folder → add GoBrainGamesSDK / BeatGameSDK to your target.
  3. Open a game:
    import GoBrainGamesSDK
    let games = GoBrainGamesCoordinator(config: .init(locale: "vi"))
    games.onEvent = { print($0.gameId, $0.name, $0.score ?? -1) }
    games.present(.sudoku, from: self)   // .go2048 .tango .patch .zip .wend .mend
    import BeatGameSDK
    BeatGameCoordinator(config: .init(locale: "vi", showTutorial: true)).present(from: self)

Prompt mẫu cho AI Agent (dán cho Claude Code / Cursor… để tự tích hợp)

Integrate the "Play2048" iOS game SDK into THIS iOS app.

Source: GitHub Release v0.0.1 of fighttechvn/play2048 — asset play2048-ios-sdk-v0.0.1.zip.
It is a Swift Package (iOS 12+, UIKit, depends on apple/swift-protobuf) with two library
products: GoBrainGamesSDK and BeatGameSDK. No WebView.

Do this:
1. Download & unzip the release asset into Packages/Play2048/ at the repo root
   (the folder containing Package.swift).
2. Add it as a LOCAL Swift package and link both products to the main app target.
   - If the project uses XcodeGen (project.yml):
       packages:
         Play2048:
           path: Packages/Play2048
       targets:
         <AppTarget>:
           dependencies:
             - package: Play2048
               product: GoBrainGamesSDK
             - package: Play2048
               product: BeatGameSDK
     then run `xcodegen generate`.
   - Otherwise add it via the .pbxproj as an XCLocalSwiftPackageReference.
3. Add a "Games"/Settings screen with one button per game. On tap, open the game:
       import GoBrainGamesSDK
       let c = GoBrainGamesCoordinator(config: .init(locale: "vi"))
       c.onEvent = { e in /* log e.gameId, e.name, e.score */ }
       c.present(.sudoku, from: self)   // games: go2048, sudoku, tango, patch, zip, wend, mend
   For Beat (music):
       import BeatGameSDK
       BeatGameCoordinator(config: .init(locale: "vi", showTutorial: true)).present(from: self)
   Keep a strong reference to the coordinator while a game is open.
4. Build for an iOS Simulator and confirm a game opens and emits game_over with a score.

Constraints: iOS 12+ deployment target; UIKit; do not modify the SDK sources.

See README.md inside the zip for full docs.