
Learn to build iOS 2D games with SpriteKit and Swift by mastering animations, particle effects, and collisions, using theory and practice to create a real world App Store game.
Download the attached exercise files, then explore section folders with artwork, imagery, and sound effects, plus beginning and end Xcode project states to start from the current app state.
Get a quick overview of SpriteKit, a graphics rendering and animation framework for sprites, offering physics, event handling, and metal-accelerated, fast animation. Learn key classes like SKSpriteNode, SKAction, and SKPhysicsBody.
Explore the key SpriteKit classes, including SKView, SKScene, and SKSpriteNode. Learn how a scene acts as the root, defines the visible area, scale mode, anchor points, and zPosition-based node ordering.
Create a SpriteKit 2D game project in Xcode by selecting the game template, naming the project, and wiring an SKView, a game scene, and a controller.
Create your first SpriteKit scene by importing textures and dragging sprites (sky, mountains, lake, boat, cloud) in Xcode, adjusting anchor point, gravity, and layering for depth.
Create a cloud animation in sprite kit using a move action with pixel offset and duration, duplicate and reverse it, loop the sequence, and test in the simulator.
Discover color track, a free iOS game with infinite scrolling background, a pulsing player, random obstacles across tracks, time-based power-ups, particles, scoring, and high-score flow.
Prepare graphic and sound assets for your iOS 2D SpriteKit game by exporting start button, background, and other elements from scratch, then import artwork and sounds.
Set up a SpriteKit Swift game project in Xcode, configure a landscape iPhone 6 Plus scene with origin at the lower-left, and import assets and sounds.
Create the main game scene by setting a hex background color, adding up, down, and right control sprites, arranging tracks, and placing a target for later coding.
Access scene sprites in code using the name property to load tracks from the scene editor into a tracks array of SKSpriteNode, then color the first track green.
Declare a global player sprite node and initialize it with an image name or an ASCII texture. Center the player on the first track and add it to the scene.
Learn to detect touches in a SpriteKit scene by handling touches began, ended, and canceled, detecting which on-screen controls (right, up, down) were pressed, and printing movement directions.
Implement touch based vertical movement in SpriteKit by moving the player up or down using a repeat action, stopping when the touch ends or is canceled.
Explore the SpriteKit rendering loop and SK actions to animate 2D scenes, update nodes, compose sequences and groups, and render efficiently at up to 60 frames per second.
Animate the player horizontally across tracks using SpriteKit actions, track progression, and a move sound, with a moving-to-track flag and a completion handler to reset it.
Learn to use SpriteKit particle emitters to create visual effects like smoke, fire, and sparks, configure the emitter node properties, and design effects in Xcode's particle editor for rapid iteration.
Explore SpriteKit particle emitters by selecting spryte kid particle templates like spark and fireworks, adjust attributes in real time, and import the fireworks emitter from assets to preview pulsing animation.
Learn to create a pulsing player effect with a SpriteKit particle emitter by tweaking texture, birth rate, lifetime, position and velocity ranges, acceleration, alpha, and color properties.
Add a pulse particle emitter to the player by creating a Pulse emitter node, initializing it with the pulse file, and attaching it as a centered child at position 0,0.
Define enemy types small, medium, and large; create a function to build an SKShapeNode enemy with a CGPath rounded rect, assign colors, and position it on track ready to spawn.
Create velocity and direction arrays for tracks to set enemy parameters. Randomly assign velocities from 180, 200, 250, set position by direction, and apply a physics body with vertical velocity.
Spawn enemies along tracks with a random type from the enumeration, repeating every two seconds via an action sequence, and remove off-screen enemies by naming them 'enemy' for performance.
Attach a SKPhysicsBody to a sprite node, apply gravity and impulses, and compare dynamic, static, and ash bodies; choose circle, rectangle, path, or alpha-channel shapes for performance and fidelity.
Explore bit masks in SpriteKit to control collisions, using category, collision, and contact test bit masks, shifting bits to assign physics bodies and handling didBeginContact.
Explore a practical SpriteKit sample that implements bitmasks and collisions with two balls and a ground, defining category and collision masks, and handling didBegin contact to respond to collisions.
Define category bit masks for the player, enemy, and target, configure their physics bodies in SpriteKit, and set collision and contact testing to track interactions.
Adopt the physics contact delegate, differentiate bodies with category bit masks, and handle collisions between the player and enemy or target, while setting gravity to zero for predictable collisions.
Boost player speed along tracks by applying track-specific CGVector velocities in SpriteKit, adjust for up or down direction, and manage last-track boundaries using the game scene's structured functions.
Define a move player to start function to reset the player when off screen or after collisions, called from update and didBeginContact to prepare the next level.
Add immersive audio by implementing ambient background noise with SKAudioNode, plus hit, level-up, and fail sound effects using SKAction, enriching gameplay in the iOS SpriteKit game.
implement a heads-up display showing time remaining and score using SpriteKit labels, with time initialized to 60 seconds and score updated via computed properties.
Create power ups in a SpriteKit game with a function returning an optional SKSpriteNode, using a power up image, configuring physics body and category, and increasing time by five seconds.
Add random power-up spawns in the spawn enemies function using a random track and GameplayKit, then collect power-ups to increase remaining time and play a sound.
Add a start scene and a game over scene, wire start and play buttons, preload scenes from files, and transition from start scene to the game scene with a fade.
Create an infinite scrolling background in SpriteKit using a scrawling background class with a static factory, integrated in the start scene and updated each frame.
Implement a game-over flow in SpriteKit by playing a level-completed sound, fading to the game over scene, and enabling restart via touches to replay the game.
Create a singleton game handler with a shared instance to manage the current score and high score across scenes, persisting them with user defaults.
Rename sprites to match the background, add a pause button, configure landscape left, and implement pause/resume logic in the game scene via touches began.
Explore next steps after your first SpriteKit 2D game by adding more physics, shaders, tiles, cameras, and lighting. Read Apple’s SpriteKit documentation, translate ideas into code, and seek feedback.
Five of the top ten highest grossing apps on the iOS App Store are games. If you ever had an idea for an amazing game but didn’t know how to create it, then this course is for you. Apple provides great game frameworks for every developer. One of these frameworks for 2D games is SpriteKit.
This course is going to take you through the process of creating a 2D arcade game step-by-step. Not only will you have finished a complete game project after taking this course, you will also get profound theoretical knowledge about the SpriteKit Framework and many of its important classes.
I am Brian Advent and I am running one of the largest youtube channels on iOS development. I am also organising the annual Swift Tutorial Conference and with my 17 years of development experience I am offering you a course with a great combination of theory and practice.
A Real World Project
This course is centred around a real world arcade game called Color Trek. You can download it on the App Store for free and you will create this game from start to finish in this course. In that process you will put all the theory that you are going to learn into practice right away.
How and what you are going to learn
SpriteKit is a huge framework, which is why you are going to start your journey with an overview about the most important classes that you are going to encounter.
You will then create your first game world and your first animations to familiarise yourself with the tools provided by Apple.
After these first steps you are going to start creating a real game from start to finish, starting with the project setup, the integration of game assets and the creation of the main game scene.
Among other things you are then going to learn both theory and practice about:
If you have never created a game before, then you will also enjoy my detailed explanations on collision detection, which is one of the most important aspects of 2D game development.
I designed this Swift course to be easily understandable for any iOS Developer who has a beginner or intermediate knowledge about the Swift programming language and the Xcode IDE.
This course comes with extensive exercise files (code files and assets) for every video, with a begin and end state of all projects. You'll be able to work alongside the instructor and will receive a verifiable certificate of completion upon finishing the course.