Book Image

iOS Game Development By Example

By : Samanyu Chopra
Book Image

iOS Game Development By Example

By: Samanyu Chopra

Overview of this book

Game development has always been an exciting subject for game enthusiasts and players and iOS game development takes a big piece of this cake in terms of perpetuating growth and creativity. With the newest version of iOS and Sprite Kit, comes a series of breathtaking features such as Metal rendering support, camera nodes, and a new and improved Scene Editor. Conceptualizing a game is a dream for both young and old. Sprite Kit is an exciting framework supported by Apple within the iOS development environment. With Sprite Kit, creating stunning games has become an easy avenue. Starting with the basics of game development and swift language, this book will guide you to create your own fully functional game. Dive in and learn how to build and deploy a game on your iOS platform using Sprite Kit game engine. Go on a detailed journey of game development on the iOS platform using the Sprite Kit game engine. Learn about various features implemented in iOS 8 that further increase the essence of game development using Sprite Kit. Build an endless runner game and implement features like physics bodies, character animations, scoring and other essential elements in a game. You will successfully conceive a 2D game along with discovering the path to reach the pinnacle of iOS game development. By the end of the book, you will not only have created an endless runner game but also have in-depth knowledge of creating larger games on the iOS platform. Style and approach An easy-to-follow, comprehensive guide that makes your learning experience more intriguing by gradually developing a Sprite Kit game. This book discusses each topic in detail making sure you attain a clear vision of the subject.
Table of Contents (17 chapters)
iOS Game Development By Example
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Setting up a project


We have discussed many things about Sprite Kit, now it's time to see a project in action and gain some practical knowledge.

The Hello World project

We'll need to create a new project to build Hello World. An Xcode project organizes everything your app needs into one convenient place. Let's begin by creating a brand new game project in Xcode by carrying out either of the first two points, and then continuing as shown in the list:

  1. Click on Create a new Xcode project on the welcome screen:

  2. Instead, you can also select File | New | Project… from the file menu:

  3. Select Game from the new project selection window:

  4. The next window asks you to customize options for your project. Fill out the fields as shown in the following screenshot:

    • Product Name: It is the name of the game

    • Organization Name: If you are an individual, then your name, or the name of the organization

    • Organization Identifier: A unique identifier of your organization

    • Bundle Identifier: It is a default ID generated automatically using organization identifier and product name.

    • Language: The programming language you are using, that is, Objective-C or Swift

    • Game Technology: The game framework being used, like Scene Kit, Sprite Kit, Metal, and so on

    • Devices: The devices you want your game to run on; iPad, iPhone, or both

    • These fields can be anything you want

  5. Press Next and Xcode will ask where to save your new project. Choose a directory and then click on Create.

  6. After saving, it should open Xcode to your brand new Hello World project, specifically to the project properties screen. On this screen, unselect the Portrait option under Device Orientation. This file will be automatically saved, so you won't have to do anything further: