NEW: Subscribe to Hacking with Swift+ and accelerate your learning! >>

Setting up

In this project we're going to produce a Flappy Bird clone called Crashy Plane. Flappy Bird might seem like a remarkably simple game when you’re playing it, but has a lot going on behind the scenes: there’s physics, animation, infinite scrolling, and more – it’s a worthy choice for a learning project.

Before you start, please download the assets for this project from https://github.com/twostraws/HackingWithSwift so you can follow along. If you haven't played Flappy Bird before, the concept is simple: tap the screen to keep your bird flying, and don't touch the floor or any pipes. In our game it'll be a plane with mountains as obstacles, but the idea is the same.

The assets you download are all licensed under CC0 / public domain, which means you can use them however you want without attribution. If you want to attribute the original authors, see the README.txt file in the zip. The game art comes from a designer called Kenney, who offers a huge selection of public domain game assets in return for a donation – if you're serious about making games you should definitely visit his home page.

All set? Great! Launch Xcode and create a new project from the game template. Choose Swift for your language and SpriteKit for the game technology, then name it Project36 and click Next then Finish. Before we go any further, please change its project settings so that it supports only iPhone in portrait – that’s the natural environment of Flappy Bird.

Subscribe to Hacking with Swift+

Sponsor Hacking with Swift and reach the world's largest Swift community!

BUY OUR BOOKS
Buy Pro Swift Buy Swift Design Patterns Buy Testing Swift Buy Hacking with iOS Buy Swift Coding Challenges Buy Swift on Sundays Volume One Buy Server-Side Swift (Vapor Edition) Buy Advanced iOS Volume One Buy Advanced iOS Volume Two Buy Advanced iOS Volume Three Buy Hacking with watchOS Buy Hacking with tvOS Buy Hacking with macOS Buy Dive Into SpriteKit Buy Swift in Sixty Seconds Buy Objective-C for Swift Developers Buy Server-Side Swift (Kitura Edition) Buy Beyond Code

Was this page useful? Let us know!

Link copied to your pasteboard.