Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Swift By Example

You're reading from   Swift By Example

Arrow left icon
Product type Paperback
Published in Jun 2015
Publisher
ISBN-13 9781785284700
Length 284 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Giordano Scalzo Giordano Scalzo
Author Profile Icon Giordano Scalzo
Giordano Scalzo
Arrow right icon
View More author details
Toc

Implementing Cube Runner


After experimenting a bit with SceneKit, let's start implementing our game.

The game skeleton

As usual, let's start by selecting the correct Xcode project template, the Game template in this case, which looks like this:

In the next screen, we add the requested data and select SceneKit as the technology, as shown here:

After selecting only Portrait as the allowed orientation, as shown in the following screenshot, we can run the example project:

The demo app shows a gorgeous rotating 3D airplane, thus showing us what we can achieve using this framework. Here is a screenshot of the plane:

Implementing the menu

For the first task in building the app, we prepare the Podfile, which contains a few pods that we'll use to build the menu view:

inhibit_all_warnings!
use_frameworks!
target 'CubeRunner' do
   pod 'Cartography', '~> 0.5'
   pod 'HTPressableButton', '~> 1.3'
   pod 'BitwiseFont', '~> 0.1.0'
end

After running the usual pod install command, we are ready to implement...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image