Logo Lanfrica

magicAyyub/bobail

Type de record:

software
Créateur:
mag
Hôte:
A two-player iOS implementation of the African board game Bobail, built with SwiftUI. # Bobail - African Board Game for iOS A two-player iOS implementation of the African board game **Bobail**, built with **SwiftUI**. --- ## Rules | Element | Description | |---|---| | Board | 5x5 grid | | Player 1 | 5 blue pawns on row 1 (top) | | Player 2 | 5 red pawns on row 5 (bottom) | | Bobail | Neutral gold piece starting at the center (C3) | **Turn structure:** 1. *First turn only:* Player 1 moves a single pawn (not the Bobail). 2. All other turns: move the Bobail one square, then slide one of your own pawns. **Pawn movement:** slides in a straight line (8 directions) and stops on the last empty square before an obstacle (any piece). **Winning conditions:** - **By camp:** bring the Bobail onto your own starting row. - **By blocking:** surround the Bobail so the opponent cannot move it on their turn. --- ## Getting Started ### Requirements - macOS 13+ with **Xcode 15+** - iOS 16+ (simulator or physical iPhone) - Swift Package: **ConfettiSwiftUI** (added via SPM, see below) ### Setup 1. **Create a new Xcode project** - *File > New > Project* -> iOS -> App - Name: **`Bobail`** / Interface: SwiftUI / Language: Swift 2. **Add the ConfettiSwiftUI package** - *File > Add Package Dependencies...* - URL: `github.com` - Branch: `master` 3. **Add the source files** Delete the `ContentView.swift` and `BobailApp.swift` files generated by Xcode, then add: ``` Bobail/ ├── BobailApp.swift ├── Models/ │ └── GameModel.swift └── Views/ ├── ContentView.swift ├── BoardView.swift ├── GameView.swift ├── TutorialView.swift └── InteractiveTutorialGameView.swift ``` In Xcode: *File > Add Files to "Bobail"* and select the `Models/` and `Views/` folders. 4. **Run** - Select a simulator or your iPhone - `Cmd+R` --- ## Architecture ``` GameModel (ObservableObject) board: [[CellContent]] current state of all cells currentPlayer: Int 1 or 2 phase: TurnPhase firstTurnMovePawn | moveBobail | moveOwnPawn s …