🎮 Shadow Runner
A modern, responsive endless runner game built with SwiftUI, featuring smooth animations, dynamic difficulty, and cross-platform support for iOS and macOS.

🎯 Game Features
🎮 Endless Runner Gameplay
Run, jump, and survive as long as possible in this addictive endless runner.
- Run, jump, and survive as long as possible
- Progressive difficulty system
- High score tracking system
📈 Dynamic Difficulty
Game speed increases over time for progressive challenge.
- Game speed increases over time
- Progressive challenge system
- Adaptive obstacle spawning
📱 Responsive Design
Optimized for all iPhone screen sizes and macOS.
- Optimized for all iPhone screen sizes (SE to Pro Max)
- Cross-platform support for iOS and macOS
- Adaptive UI scaling
🎵 Audio System
Customizable audio controls with background music and sound effects.
- Toggle background music and sound effects
- Volume control settings
- Settings persistence between sessions
🚀 Getting Started
Prerequisites
- Xcode: Xcode 15.0+ (for iOS 17.0+ and macOS 14.0+)
- iOS: iOS 17.0+ or macOS 14.0+
- macOS: macOS 14.0+
- Swift: Swift 5.9+
Installation
git clone https://github.com/itnams/Shadow-Runner.git
cd Shadow-Runner
open "Shadow Runner.xcodeproj"
Select your target device (iOS device or macOS), then build and run the project (⌘+R).
🏗️ Project Structure
Assets.xcassets
Game assets and images including app icon, character sprite, obstacle sprite, and accent color.
ContentView.swift
Main game view and logic with game state management and rendering.
Shadow_RunnerApp.swift
App entry point and main configuration.
Shadow_Runner.entitlements
App entitlements and permissions configuration.
🎮 Game Architecture
Core Components
1. Game State Management
struct GameState {
var isGameActive: Bool = false
var gameOver: Bool = false
var characterY: Double = 0
var characterVelocity: Double = 0
var obstacles: [Obstacle] = []
var survivalTime: TimeInterval = 0
var highScore: TimeInterval = 0
var gameSpeed: Double = 150
var obstacleSpawnInterval: TimeInterval = 2.0
}
2. Audio Management
class AudioManager: ObservableObject {
var jumpSound: AVAudioPlayer?
var backgroundMusic: AVAudioPlayer?
var isBackgroundMusicEnabled = true
var isJumpSoundEnabled = true
}
3. Responsive Design
struct GameConstants {
static func getGroundY(for screenHeight: CGFloat) -> Double {
return Double(screenHeight * 0.85)
}
static func getCharacterStartY(for screenHeight: CGFloat) -> Double {
return getGroundY(for: screenHeight) - characterSize/2
}
}
Game Loop
- TimelineView(.animation): Provides continuous 60fps updates
- Canvas Rendering: Custom 2D drawing for game elements
- Physics Updates: Gravity, collision detection, obstacle movement
- UI Updates: Score display, game state changes
🎨 Visual Design
Background System
- Parallax Scrolling: Multiple layers moving at different speeds
- Dynamic Elements: Stars, clouds, mountains, particles
- Responsive Layout: Adapts to all screen sizes and orientations
Character Design
- Shadow Character: Simple, recognizable design
- Smooth Animations: Fluid movement and physics
- Collision Detection: Precise hitbox calculations
UI Components
- Modern Cards: Beautiful start game and game over screens
- Audio Controls: Toggle buttons for music and sound effects
- Score Display: Real-time survival time tracking
- Responsive Layout: Adapts to all screen sizes and orientations
🎵 Audio System
Sound Effects
- Jump Sound: pixel-jump-319167.mp3
- Background Music: Battle_Ready.mp3 (looping)
Audio Features
- Volume Control: Adjustable background music volume
- Toggle Controls: Enable/disable music and sound effects
- Settings Persistence: Audio preferences saved between sessions
- Cross-Platform: Works on both iOS and macOS
📱 Device Compatibility
iPhone Models
iPhone SE (1st & 2nd gen)
667px height
iPhone 8, 8 Plus
667px, 736px height
iPhone X, XS, XR
812px, 896px height
iPhone 11, 11 Pro, 11 Pro Max
896px height
iPhone 12, 12 mini, 12 Pro, 12 Pro Max
844px, 926px height
iPhone 13, 13 mini, 13 Pro, 13 Pro Max
844px, 926px height
iPhone 14, 14 Plus, 14 Pro, 14 Pro Max
844px, 932px height
iPhone 15, 15 Plus, 15 Pro, 15 Pro Max
844px, 932px height
Responsive Features
- Dynamic Ground Positioning: Automatically adjusts to screen height
- Safe Area Support: Respects notch and Dynamic Island
- Orientation Support: Optimized for landscape gameplay
- Adaptive UI: Elements scale appropriately for all screen sizes
Ready to Play Shadow Runner?
Contact me to learn more about Shadow Runner or discuss your iOS/macOS game development needs