Skip to content

mazjap/SpiderSolitaire

Repository files navigation

Spider Solitaire

Features

  • 🃏 Classic Spider Solitaire gameplay
  • 🌈 Smooth animations and intuitive drag-and-drop interface
  • 🔢 Multiple difficulty levels (1, 2, or 4 suits)
  • ⏱️ Time and move tracking
  • 💡 Hints
  • 👆 Tap to move
  • 🏆 Score calculation
  • 💾 Game state persistence
  • 🌄 Landscape & macOS support
  • 🎆 Win animation
  • 🎨 Customizable card designs

Screenshots

Start Card Movement Undo
Cards layed out in 10 columns, with only the top-most cards revealed Cards being dragged or tapped from one column to another, flipping the subsequent card in the stack that was pulled from Cards being returned to their previous position, via an undo button
Draw Hint Complete Set

Requirements

  • iOS 18.0+/macOS 14.0+
  • Xcode 16.0+
  • Swift 6

Installation

  1. Clone the repository:
git clone https://github.com/mazjap/spider-solitaire.git
  1. Open the project in Xcode:
cd spider-solitaire
open SpiderSolitaire.xcodeproj
  1. Build and run the project in Xcode.

How to Play

  1. Choose your difficulty level: 1 suit (Easiest), 2 suits (Medium), or 4 suits (Hard).
  2. Drag cards to build descending sequences of the same suit.
  3. Complete a sequence from King to Ace to remove it from the table.
  4. Use the draw pile to add new cards when you're stuck.
  5. Clear all cards from the table to win!

Architecture

This project follows the MVVM (Model-View-ViewModel) architecture and utilizes SwiftUI's latest features:

  • GameView: Main view containing the game board
  • CardView: Custom view for rendering individual cards
  • CardStackView: Manages stacks of cards in columns
  • GameViewModel: Handles game logic and state management
  • GameState: Represents the current state of the game

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

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

About

A spider solitaire game written with SwiftUI

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages