Swift Game Programming for Absolute Beginners

Arjan Egges

Language: English

Publisher: Apress

Published: Jul 23, 2015

Description:

Swift Game Programming for Absolute Beginners teaches Apple’s Swift language in the context of four, fun and colorful games. Learn the Swift 2.0 language, and learn to create game apps for iOS at the same time – a double win!

The four games you’ll develop while reading this book are:

  • Painter
  • Tut’s Tomb
  • Penguin Pairs
  • Tick Tick

These four games are casual, arcade-style games representing the aim-and-shoot, casual, puzzle, and platform styles of game play. Professionally developed game assets form part of the book download. You’ll get professionally drawn sprites and imagery that’ll have you proud to show your learning to friends and family.

The approach in Swift Game Programming for Absolute Beginners follows the structure of a game rather than the syntax of a language. You’ll learn to create game worlds, manage game objects and game states, define levels for players to pass through, implement animations based upon realistic physics, and much more. Along the way you’ll learn the language, but always in the context of fun and games.

Swift is Apple’s new programming language introduced in 2014 to replace Objective-C as the main programming language for iOS devices and Mac OS X. Swift is a must learn language for anyone targeting Apple devices, and Swift Game Programming for Absolute Beginners provides the most fun you’ll ever have in stepping over the threshold toward eventual mastery of the language.

What you’ll learn

  • Write applications in possibly the most important new language of the decade
  • Create games to run on Apple devices such as phones and tablets, and desktops too
  • Create and manage game worlds having multiple levels through which players progress
  • React to player input whether from mouse, keyboard, or touch
  • Achieve realistic movement of game objects through applied physics
  • Prepare your games properly for commercial deployment

Who this book is for

Swift Game Programming for Absolute Beginners is for programmers and technology enthusiasts wanting to learn to program and develop applications for Apple devices such as phones and tablets. The book is also for anyone wanting to learn to program in Apple's new language named Swift. No prior knowledge of Swift is assumed. Swift Game Programming for Absolute Beginners teaches the Swift language from scratch in the context of creating a series of fun and colorful games that you'll be proud to develop and show to your friends, neighbors, and colleagues.

Table of Contents

Part I: Getting Started

  1. The Swift Language

  2. Game Programming Basics

  3. Creating a Game World

  4. Game Assets

Part II: Painter

  1. Knowing What the Player is Doing

  2. Reacting to Player Input

  3. Basic Game Objects

  4. Game Object Types

  5. Colors and Collisions

  6. Limited Lives

  7. Organizing Game Objects

  8. Finishing the Painter Game

Part III: Galactic Waste

  1. Adapting to Different Devices

  2. Game Object Hierarchies

  3. Game Physics

  4. Game Object Interaction

  5. Finishing the Galactic Waste Game

Part IV: Penguin Pairs

  1. Sprite Sheets

  2. Storing and Recalling Game Data

  3. Pairing the Penguins

  4. Finishing the Penguin Pairs Game

  5. The Main Game Structure

  6. Animation

Part V: Tick Tick

  1. Platform Game Physics

  2. Intelligent Enemies

  3. Adding Player Interaction

  4. Finishing the Tick Tick Game

**