English | 简体中文
Learn Swift by building a real game, develop creative confidence through making, and prepare for the WWDC Swift Student Challenge.
This repository is an open-source teaching project built with Swift Playgrounds, SwiftUI, and SpriteKit. It is designed for absolute beginners who want a practical path into Swift, interactive app development, and project-based learning.
The project is also the codebase behind a tutorial series covering beginner-friendly game development, AI-assisted coding, debugging, version control, and iterative feature building. It is open-sourced to lower the barrier for students, share a repeatable learning path, and help more people turn ideas into working software.
- Teach fundamental
Swiftconcepts through a concrete, playable project - Give beginners a realistic starting point for
Swift Playgrounds - Provide inspiration and technical direction for
WWDC Swift Student Challenge - Show how AI tools can support feature development, debugging, and iteration
- Encourage students to express ideas through code and build original work
The author is a two-time Swift Student Challenge winner and created this repository to share a more accessible starting point with the community.
- Basic Swift programming through real gameplay features
- How
SwiftUIandSpriteKitcan work together in one app - How to structure a small game project with managers, scenes, and entities
- How to iterate on features instead of trying to design everything upfront
- How to use GitHub and AI tools as part of a beginner-friendly workflow
- Main menu and game start flow
- Virtual joystick movement
- Tap-to-shoot interaction
- Enemy tracking, damage, destruction, and scoring
- Collision detection and damage resolution
- High score persistence
- Dynamic difficulty scaling
- Power-up drops and effect management
- Wave system
- Boss warning, boss spawning, and boss health UI
- Tutorial and onboarding system
- Pause menu and return-to-menu flow
Swift 6SwiftUISpriteKitSwift Package ManagerAppleProductTypes
Minimum platform:
iOS 16.0+
- Open
Swift Playgrounds - Import or open
game.swiftpm - Run the project
- Open the project directory with
Xcode 16or later - Select an iPhone or iPad simulator
- Run the app
- Virtual joystick on the lower-left: move the ship
- Tap the screen: fire toward the tapped position
- Collect power-ups: gain healing, shield, or fire-rate boosts
- Survive longer and defeat more enemies: increase score and difficulty
.
├── game.swiftpm/ # Main Swift Playgrounds project
│ ├── MyApp.swift
│ ├── ContentView.swift
│ ├── GameView.swift
│ ├── GameScene.swift
│ ├── GameManager.swift
│ ├── Player.swift
│ ├── Enemy.swift
│ ├── Projectile.swift
│ ├── CollisionDetector.swift
│ ├── DifficultyManager.swift
│ ├── PowerUp*.swift
│ ├── Boss*.swift
│ └── Tutorial*.swift
├── docs/assets/ # README assets
├── web-infographic/ # Supporting web infographic resources
├── README.md
├── README.zh-CN.md
└── LICENSE
- Students with zero or limited
Swiftexperience - Learners exploring
Swift Playgroundsthrough project-based practice - Students preparing for the
WWDC Swift Student Challenge - Developers practicing
SwiftUI + SpriteKit - Educators and creators demonstrating AI-assisted coding workflows
These videos all use the same Swift Playgrounds project as their teaching base:
- Build a game from scratch with Swift
- AI coding and GitHub workflow
- Four essential Claude Code features
- Fix build errors with AI
- Use AI to speed up mini-game feature development
Recommended order:
- Start with the core gameplay and project setup
- Move on to AI-assisted feature expansion
- Finish with debugging and GitHub workflow practice
This repository is not meant to be a production-ready commercial game template. It is a teaching-first project built around a simple principle:
- start small
- make something playable early
- learn by shipping features
- improve through iteration
The broader goal is to help beginners see programming as a creative medium for building original work, not just as a set of abstract syntax rules.
- Sound effects and background music
- More enemy types
- More complete boss mechanics and phases
- Wave summary and stage selection
- Local save data and achievements
- More structured tutorial docs and visual assets
This project is licensed under the MIT License. See LICENSE for details.
