Skip to content

efemesudiyeli/Spyquest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

47 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ•ต๏ธ Spyquest - Multiplayer Spyfall Game

iOS Swift SwiftUI Firebase

๐Ÿ“– Overview

Spyquest is a modern iOS adaptation of the popular party game Spyfall. Built with SwiftUI and Firebase, it offers both local and real-time multiplayer gameplay where players must identify the spy among them while the spy tries to figure out the secret location.

โœจ Features

๐ŸŽฎ Game Modes

  • Local Multiplayer: Play with friends on the same device (3-8 players)
  • Online Multiplayer: Real-time gameplay with lobby system (3-8 players)
  • Anonymous Authentication: Quick join without account creation

๐ŸŒ Rich Content

  • 100+ Locations across 6 different themed sets:
    • First Edition: Classic Spyfall locations (Airplane, Bank, Hospital, etc.)
    • Second Edition: Extended locations (Art Museum, Gaming Convention, etc.)
    • Combined Edition: Both editions together
    • Extra Edition: Custom locations (Aquarium, Brewery, Castle, etc.)
    • Pirates Edition: 21 pirate-themed locations with detailed descriptions
    • Wild West Edition: 25 western-themed locations with immersive backstories

๐ŸŽฏ Core Gameplay

  • Role Assignment: Automatic spy and location role distribution
  • Timer System: 8.5-minute rounds with real-time synchronization
  • Voting Mechanism: Democratic spy identification system
  • Spy Guess Feature: Strategic location guessing for spies
  • Smart Game Logic: Complex win/lose conditions handling ties and edge cases

๐ŸŒ Multiplayer Features

  • Real-time Sync: Firebase Realtime Database integration
  • Lobby System: Create/join games with 6-character codes
  • Presence Tracking: Online/offline player status
  • Host Controls: Game state management and player coordination
  • Auto-cleanup: Orphaned lobby detection and removal
  • Graceful Disconnection: Handles network issues and player drops

๐ŸŽจ User Experience

  • Localization: Multi-language support (English, Turkish, French)
  • Modern UI: SwiftUI with iOS 16+ design patterns
  • Responsive Design: Optimized for various screen sizes
  • Accessibility: VoiceOver and accessibility features
  • Smooth Animations: Polished transitions and interactions

๐Ÿ’Ž Premium Features

  • Ad-free Experience: Remove interstitial advertisements
  • Premium Location Sets: Access to Pirates and Wild West editions
  • RevenueCat Integration: Subscription management
  • Restore Purchases: Cross-device purchase restoration

๐Ÿ›  Technical Architecture

Frontend

  • SwiftUI: Modern declarative UI framework
  • MVVM Pattern: Clean separation of concerns
  • Combine Framework: Reactive programming for state management
  • NavigationStack: iOS 16+ navigation system

Backend & Services

  • Firebase Realtime Database: Real-time multiplayer synchronization
  • Firebase Anonymous Auth: Seamless user authentication
  • RevenueCat: Subscription and in-app purchase management
  • Google Mobile Ads: Monetization through interstitial ads

Key Components

โ”œโ”€โ”€ Models/
โ”‚   โ”œโ”€โ”€ Location.swift          # Game locations and themes
โ”‚   โ””โ”€โ”€ Player.swift           # Player data and roles
โ”œโ”€โ”€ ViewModels/
โ”‚   โ”œโ”€โ”€ GameViewModel.swift     # Local game logic
โ”‚   โ””โ”€โ”€ MultiplayerGameViewModel.swift  # Online multiplayer logic
โ”œโ”€โ”€ Views/
โ”‚   โ”œโ”€โ”€ MainMenuView.swift      # App entry point
โ”‚   โ”œโ”€โ”€ MultiplayerLobbyView.swift  # Online lobby management
โ”‚   โ”œโ”€โ”€ GamePlayingView.swift   # Active gameplay interface
โ”‚   โ”œโ”€โ”€ VotingView.swift        # Voting mechanism
โ”‚   โ””โ”€โ”€ RoleRevealView.swift    # Role assignment display
โ””โ”€โ”€ Extensions/
    โ”œโ”€โ”€ Bundle.swift           # App configuration
    โ””โ”€โ”€ View.swift            # UI extensions

๐ŸŽฏ Game Rules

Objective

  • Players: Identify the spy before time runs out
  • Spy: Figure out the location without getting caught

Gameplay Flow

  1. Setup: App assigns roles and secret location
  2. Discussion: Players ask questions about the location
  3. Voting: Democratic process to identify the spy
  4. Spy Guess: Spy can guess the location at any time
  5. Resolution: Win conditions based on voting results and spy actions

Win Conditions

  • Players Win: Spy is correctly identified OR spy guesses wrong location
  • Spy Wins: Spy correctly guesses location OR voting results in tie/wrong accusation

๐Ÿš€ Technical Highlights

Real-time Multiplayer

  • Server-synchronized timers with offset compensation
  • Presence tracking with automatic cleanup
  • Robust error handling for network issues
  • Optimistic UI updates for smooth experience

Smart Game Logic

  • Complex voting resolution with tie-breaking rules
  • Majority vote detection with time reduction
  • Auto-game ending when conditions are met
  • State persistence across network disruptions

Performance Optimizations

  • Efficient Firebase queries with minimal data transfer
  • Memory management with weak references
  • Background processing for non-critical operations
  • Optimized UI updates on main thread

Security & Privacy

  • Anonymous authentication for privacy
  • Secure lobby codes with collision prevention
  • Input validation and sanitization
  • No personal data collection

๐Ÿ“ฑ System Requirements

  • iOS: 17.0+
  • Xcode: 14.0+
  • Swift: 5.7+
  • Device: iPhone

๐ŸŽจ Design Philosophy

The app follows Apple's Human Interface Guidelines with:

  • Intuitive Navigation: Clear user flows and logical information architecture
  • Consistent Visual Language: Unified color scheme and typography
  • Accessibility First: VoiceOver support and inclusive design
  • Performance: Smooth 60fps animations and responsive interactions

๐Ÿ”ง Development Features

Code Quality

  • MVVM Architecture: Clean separation of business logic and UI
  • Memory Safety: No force unwraps, proper optional handling
  • Error Handling: Comprehensive error states and user feedback
  • Localization: Internationalization support with string catalogs

Testing & Debugging

  • Preview Support: SwiftUI previews for rapid development
  • Debug Logging: Conditional compilation for production builds
  • Crash Prevention: Defensive programming practices

๐ŸŒŸ Portfolio Highlights

This project demonstrates expertise in:

  • iOS Development: Advanced SwiftUI, Combine, and iOS SDK usage
  • Real-time Systems: Firebase integration with complex state management
  • User Experience: Polished UI/UX with accessibility considerations
  • Architecture: Scalable MVVM pattern with clean code practices
  • Monetization: Premium features and ad integration
  • Localization: Multi-language support and cultural adaptation
  • Game Development: Complex game logic and state machines
  • Performance: Optimized for smooth real-time multiplayer experience

Spyquest represents a complete iOS application showcasing modern development practices, real-time multiplayer capabilities, and polished user experience design. The project demonstrates proficiency in advanced iOS development concepts while delivering an engaging and accessible gaming experience.

About

iOS multiplayer party game built with SwiftUI & Firebase. Real-time lobbies, 6 themed location sets, voting system, and premium content.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

โšก