Skip to content

khuynh22/WWDC23-CheckerGame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

17 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽฎ WWDC23 Checkers Game

Swift Platform Swift Playgrounds WWDC23 License

WWDC23 Checkers Game Main Screen

An elegant, educational checkers game built with SwiftUI for the WWDC23 Student Scholarship. This project bridges the gap in the macOS gaming landscape while providing an accessible platform for younger players to learn the timeless strategy game of checkers.

๐ŸŒŸ Highlights

  • User-Centered Design: Developed through iterative Figma prototyping with user testing from 6 participants
  • AI-Powered Opponent: Intelligent computer player using strategic algorithms for engaging gameplay
  • Educational Focus: Built-in tutorial system perfect for beginners learning checkers
  • Native Performance: Leverages SwiftUI and modern Apple frameworks for smooth, responsive gameplay
  • Accessibility First: Designed with inclusivity in mind for players of all skill levels

โœจ Features

Game Modes

  • ๐Ÿ‘ฅ Player vs Player: Classic two-player mode for head-to-head matches
  • ๐Ÿค– Player vs Computer: Challenge an AI opponent with strategic move selection
  • ๐Ÿ“š How to Play: Interactive tutorial explaining checkers rules and gameplay

Gameplay Features

  • โœ… Full checkers ruleset implementation
  • ๐Ÿ‘‘ King pieces with bidirectional movement
  • ๐ŸŽฏ Mandatory capture detection
  • ๐Ÿ”„ Multiple consecutive jumps
  • ๐ŸŽจ Beautiful, intuitive game board interface
  • ๐ŸŽต Immersive sound effects (AVFoundation)
  • ๐Ÿ† Win condition detection

Technical Features

  • Modern SwiftUI architecture
  • Declarative UI patterns
  • Efficient state management
  • Smooth animations and transitions
  • Responsive layout supporting iPad and iPhone

๐Ÿ—๏ธ Architecture

The project follows a clean SwiftUI architecture with clear separation of concerns:

My Checker App WWDC.swiftpm/
โ”œโ”€โ”€ GamePlay.swift      # App entry point
โ”œโ”€โ”€ MainMenu.swift      # Main menu view
โ”œโ”€โ”€ VsPlayer.swift      # Player vs Player game logic
โ”œโ”€โ”€ VsComp.swift        # Player vs Computer with AI
โ”œโ”€โ”€ HowToPlay.swift     # Tutorial screen
โ”œโ”€โ”€ Features.swift      # Checker piece model
โ”œโ”€โ”€ Coordinate.swift    # Board position structure
โ”œโ”€โ”€ Select.swift        # Game mode enumeration
โ””โ”€โ”€ Assets.xcassets/    # Images and visual assets

Key Components

  • Game State Management: Efficient 2D array-based board representation
  • Move Validation: Comprehensive logic for legal moves and captures
  • AI Algorithm: Strategic move selection with capture prioritization
  • King Promotion: Automatic piece upgrade at board edges

๐Ÿš€ Getting Started

โšก Want to jump right in? Check out our Quick Start Guide for a 5-minute setup!

Prerequisites

  • macOS 12.0 or later
  • Swift Playgrounds 4.0+ (available on Mac App Store)
  • Xcode 14.0+ (optional, for advanced development)

Installation

  1. Download Swift Playgrounds

    # Install from Mac App Store or visit:
    # https://apps.apple.com/app/swift-playgrounds/id1496833156
  2. Clone the Repository

    git clone https://github.com/khuynh22/WWDC23-CheckerGame.git
    cd WWDC23-CheckerGame
  3. Open the Project

    • Launch Swift Playgrounds
    • Select "Open" and navigate to My Checker App WWDC.swiftpm
    • Click "Open"
  4. Run the Game

    • Click the "Run" button in Swift Playgrounds
    • For the best experience, run in full-screen mode (View โ†’ Full Screen or โŒƒโŒ˜F)
    • Supports both iPad and Mac devices

Quick Start Guide

  1. Launch the app and select your preferred game mode
  2. In Player vs Player mode, black moves first
  3. Click a piece to select it, then click a highlighted square to move
  4. Captures are mandatory when available
  5. Reach the opposite end to crown your piece as a King
  6. Win by capturing all opponent pieces or blocking all their moves

๐Ÿ“– For detailed setup instructions, troubleshooting, and development tips, see QUICK_START.md

๐Ÿ› ๏ธ Technologies & Frameworks

Technology Purpose
SwiftUI Modern declarative UI framework for building responsive interfaces
AVFoundation Audio playback for engaging sound effects
Swift 5.8 Powerful, type-safe programming language
Swift Playgrounds Interactive development environment optimized for learning

๐Ÿ“– Development Journey

Design Process with Figma

Design Phase

  1. Wireframing: Created initial designs in Figma focusing on clarity and usability
  2. User Testing: Conducted testing sessions with 6 participants to gather feedback
  3. Iteration: Refined design based on user insights and accessibility considerations

Development in Swift Playgrounds

Implementation Phase

  1. Core Logic: Built game rules engine with move validation
  2. AI Development: Implemented strategic computer opponent
  3. UI Polish: Created smooth animations and responsive layouts
  4. Testing: Ensured robust gameplay across various scenarios

This project deepened my understanding of Swift, SwiftUI, and game development principles. The WWDC Student Scholarship opportunity was instrumental in motivating this learning journey.

๐Ÿค Contributing

Contributions are welcome! Whether you're fixing bugs, improving documentation, or proposing new features, your help is appreciated.

How to Contribute

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Reporting Issues

Found a bug or have a feature request? Please open an issue with:

  • Clear description of the problem or suggestion
  • Steps to reproduce (for bugs)
  • Expected vs actual behavior
  • Screenshots if applicable

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

Created by Khang Nguyen Huynh for the WWDC23 Student Scholarship submission.

While the MIT License grants broad permissions, the author appreciates being contacted at timhuynhwork@gmail.com before significant reuse or commercialization of this work.

๐Ÿ™ Acknowledgments

  • Apple Inc. - For the incredible WWDC Student Scholarship program and Swift Playgrounds platform
  • User Testers - The 6 participants whose feedback shaped the final design
  • Swift Community - For extensive documentation and learning resources
  • You - For taking the time to explore this project!

๐Ÿ“ฌ Contact

Khang Nguyen Huynh
๐Ÿ“ง Email: timhuynhwork@gmail.com
๐Ÿ™ GitHub: @khuynh22


Built with โค๏ธ and Swift for WWDC23

โญ If you find this project helpful, please consider giving it a star!

About

This repo holds the WWDC23 Project of Khang Nguyen Huynh

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages