Skip to content

An open-source SwiftUI chess app featuring simple, intuitive gameplay with complex underlying logic. Built for seamless interaction and responsive design, this project offers a great starting point for SwiftUI developers interested in game logic and UI development.

Notifications You must be signed in to change notification settings

jaredcassoutt/chess_swiftui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SwiftUI Chess Game

A full-featured chess game built with SwiftUI, where you can play against AI opponents with varying difficulty levels. Designed to be easy to play, fun, and a bit of a brain teaser, this app includes all the classic rules of chess—check, checkmate, castling, en passant, and pawn promotion.

Preview

Preview

Features

  • Three AI Difficulty Levels: Choose from Easy, Medium, and Hard to match your skill level.
  • Dynamic Board and Smooth Animations: Responsive chessboard layout with SwiftUI animations.
  • Classic Chess Mechanics: Includes check, checkmate, stalemate detection, castling, en passant, and pawn promotion.
  • User-Friendly Alerts: Game-over alerts for checkmate, stalemate, and options to reset the game or change difficulty.

Getting Started

  1. Clone the Repository:
     git clone https://github.com/jaredcassoutt/chess_swiftui.git
    
  2. Open the Project in Xcode:
    • Open Chess.xcodeproj in Xcode.
    • Make sure you’re running Xcode 12 or later.
  3. Run the App:
    • Build and run on the simulator or an actual device.
    • Select a difficulty and start playing!

How It Works

The project contains three main components:

  • ChessView.swift: The UI layout for the board, including piece placement and interactive moves.
  • ChessGame.swift: The game engine that handles the rules, piece movement logic, and game states.
  • OpponentChessEngine.swift: The AI engine, using minimax for advanced moves in Hard mode and capturing strategies in Medium mode.

Future Enhancements

  • Online Multiplayer: For real-time games with friends.
  • Advanced AI: A deeper minimax algorithm for a stronger Hard mode.
  • Sound Effects and Animations: Adding flair to captures and game-end scenarios.

Contributing

Feel free to fork the project, submit issues, or suggest improvements. I’d love to hear your feedback or collaborate on new features.

License

This project is open-source under the MIT License.

Thanks for checking out my SwiftUI chess game! Dive into the code, play a few rounds, and let me know if you spot any sneaky moves I might have missed.

About

An open-source SwiftUI chess app featuring simple, intuitive gameplay with complex underlying logic. Built for seamless interaction and responsive design, this project offers a great starting point for SwiftUI developers interested in game logic and UI development.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages