Skip to content

yangsijun/CrownPrix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

89 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Crown Prix

A minimalist 2D top-down racing game, designed from the ground up exclusively for Apple Watch.

Steer with the Digital Crown. Race 24 real-world circuits. Climb the global leaderboard.

Download on the App Store

Website

Features

  • Digital Crown Steering -- Turn the crown to steer. Intuitive analog control built for the wrist.
  • 24 Real-World Circuits -- Every track from the current F1 calendar, faithfully recreated from SVG data.
  • Sector Timing -- Three sectors per track with purple (personal best) sector indicators.
  • Game Center Leaderboards -- Global rankings for every circuit. See where you stand.
  • iOS Companion App -- Browse leaderboards, view rankings, and jump into races from your iPhone.
  • Haptic Feedback -- Feel the track through your wrist with native watchOS haptics.

How It Works

The game runs entirely on Apple Watch. Tracks are parsed from SVG path data at load time, sampled into a dense polyline, and rendered as a continuous road with collision boundaries. A lightweight physics engine handles acceleration, steering curves, and wall collisions. The Digital Crown provides proportional analog input for steering.

Architecture

Watch App
├── Game/          # SpriteKit scene, car physics, camera, collision, lap & sector detection
├── Pipeline/      # SVG parsing → polyline sampling → track preprocessing
├── Input/         # Digital Crown input handler
├── Config/        # Game tuning parameters
├── Systems/       # Game Center, WatchConnectivity, haptics, persistence
├── UI/            # SwiftUI views (home, track select, race, results, leaderboard)
├── HUD/           # In-race heads-up display
├── Models/        # Track metadata, race results, sector data
└── Data/          # Track registry (24 circuits)

iOS Companion App
├── Views/         # Track list, leaderboard, about sheet
├── Models/        # Shared track metadata, time formatting
├── GameCenterManager
└── PhoneConnectivityManager

Sync

Race times and leaderboard data sync between Watch and iPhone via WatchConnectivity, with automatic fallback from sendMessage to transferUserInfo for reliability.

Tracks

Circuit Country
🇦🇺 Albert Park Circuit Australia
🇨🇳 Shanghai International Circuit China
🇯🇵 Suzuka International Racing Course Japan
🇧🇭 Bahrain International Circuit Bahrain
🇸🇦 Jeddah Corniche Circuit Saudi Arabia
🇺🇸 Miami International Autodrome USA
🇨🇦 Circuit Gilles Villeneuve Canada
🇲🇨 Circuit de Monaco Monaco
🇪🇸 Circuit de Barcelona-Catalunya Spain
🇦🇹 Red Bull Ring Austria
🇬🇧 Silverstone Circuit UK
🇧🇪 Circuit de Spa-Francorchamps Belgium
🇭🇺 Hungaroring Hungary
🇳🇱 Circuit Zandvoort Netherlands
🇮🇹 Autodromo Nazionale Monza Italy
🇪🇸 Circuito de Madring Spain
🇦🇿 Baku City Circuit Azerbaijan
🇸🇬 Marina Bay Street Circuit Singapore
🇺🇸 Circuit of the Americas USA
🇲🇽 Autodromo Hermanos Rodriguez Mexico
🇧🇷 Autodromo Jose Carlos Pace Brazil
🇺🇸 Las Vegas Strip Circuit USA
🇶🇦 Losail International Circuit Qatar
🇦🇪 Yas Marina Circuit UAE

Requirements

  • watchOS 10.0+
  • iOS 17.0+
  • Xcode 16.0+

Author

Yang Sijun -- sijun.dev

License

All rights reserved.

About

A minimalist 2D top-down racing game, designed from the ground up exclusively for Apple Watch.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors