Game Development with Swift

Embrace the mobile gaming revolution and bring your iPhone game ideas to life with Swift

Game Development with Swift

This ebook is included in a Mapt subscription
Stephen Haney

1 customer reviews
Embrace the mobile gaming revolution and bring your iPhone game ideas to life with Swift
$10.00
$39.99
RRP $31.99
RRP $39.99
eBook
Print + eBook
Subscribe and access every Packt eBook & Video.
 
  • 4,000+ eBooks & Videos
  • 40+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 
Preview in Mapt

Book Details

ISBN 139781783550531
Paperback224 pages

Book Description

Apple's new programming language, Swift, is fast, safe, accessible—the perfect choice for game development! Packed with best practices and easy-to-use examples, this book leads you step by step through the development of your first Swift game.

The book starts by introducing Swift's best features for game development. Then, you will learn how to animate sprites and textures. Along the way, you will master the physics framework, add the player character and NPCs, and implement controls. Towards the end of the book, you will polish your game with fun menus, integrate with Apple Game Center for leaderboards and achievements, and then finally, learn how to publish your finished games to the App Store. By the end of this book, you will be able to create your own iOS games using Swift and SpriteKit.

Table of Contents

Chapter 1: Designing Games with Swift
Why you will love Swift
Are there any downsides to Swift?
Prerequisites
What you will learn in this book
Further research
Setting up your development environment
Creating our first Swift game
Summary
Chapter 2: Sprites, Camera, Actions!
Sharpening our pencils
Checkpoint 2- A
Drawing your first sprite
The story on positioning
Adding textures and game art
Organizing your assets
Putting it all together
Centering the camera on a sprite
Checkpoint 2-B
Summary
Chapter 3: Mix in the Physics
Laying the foundation
Exploring the physics system
Checkpoint 3-A
Exploring physics simulation mechanics
Bee meets bee
Checkpoint 3-B
Summary
Chapter 4: Adding Controls
Retrofitting the Player class for flight
Polling for device movement with Core Motion
Checkpoint 4-A
Wiring up the sprite onTap events
Teaching our penguin to fly
Improving the camera
Pushing Pierre forward
Checkpoint 4-B
Summary
Chapter 5: Spawning Enemies, Coins, and Power-ups
Introducing the cast
Organizing the project navigator
Testing the new game objects
Checkpoint 5-A
Summary
Chapter 6: Generating a Never-Ending World
Designing levels with the SpriteKit scene editor
Encounters in endless flying
Integrating scenes into the game
Checkpoint 6-A
Spawning endless encounters
Spawning the star power-up at random
Checkpoint 6-B
Summary
Chapter 7: Implementing Collision Events
Learning the SpriteKit collision vocabulary
Adding contact events to our game
Checkpoint 7-A
Player health and damage
Collecting coins
The power-up star logic
Checkpoint 7-B
Summary
Chapter 8: Polishing to a Shine – HUD, Parallax Backgrounds, Particles, and More
Adding a heads-up display
Parallax background layers
Checkpoint 8-A
Harnessing SpriteKit's particle system
Granting safety as the game starts
Checkpoint 8-B
Summary
Chapter 9: Adding Menus and Sounds
Building the main menu
Adding the restart game menu
Checkpoint 9-A
Adding music and sound
Checkpoint 9-B
Summary
Chapter 10: Integrating with Game Center
Registering an app with iTunes Connect
Authenticating the player's Game Center account
Opening Game Center in our game
Checkpoint 10-A
Adding a leaderboard of high scores
Adding an achievement
Checkpoint 10-B
Summary
Chapter 11: Ship It! Preparing for the App Store and Publication
Finalizing assets
Finalizing iTunes Connect information
Uploading our project from Xcode
Submitting for review in iTunes Connect
Summary

What You Will Learn

  • Deliver powerful graphics, physics, and sound in your game by using SpriteKit
  • Explore drawing and animation techniques for fun and quick results
  • Read and react to various forms of player input including physical device tilt and touch recognition
  • Master Apple's IDE, Xcode, and the accompanying toolset
  • Polish your menus and HUD to make your game stand out
  • Integrate your game with Game Center so that your players can share their high scores and achievements
  • Maximize gameplay with little-known tips and strategies for fun and repeatable action
  • Publish your hard work to the App Store and enjoy as people play your games

Authors

Table of Contents

Chapter 1: Designing Games with Swift
Why you will love Swift
Are there any downsides to Swift?
Prerequisites
What you will learn in this book
Further research
Setting up your development environment
Creating our first Swift game
Summary
Chapter 2: Sprites, Camera, Actions!
Sharpening our pencils
Checkpoint 2- A
Drawing your first sprite
The story on positioning
Adding textures and game art
Organizing your assets
Putting it all together
Centering the camera on a sprite
Checkpoint 2-B
Summary
Chapter 3: Mix in the Physics
Laying the foundation
Exploring the physics system
Checkpoint 3-A
Exploring physics simulation mechanics
Bee meets bee
Checkpoint 3-B
Summary
Chapter 4: Adding Controls
Retrofitting the Player class for flight
Polling for device movement with Core Motion
Checkpoint 4-A
Wiring up the sprite onTap events
Teaching our penguin to fly
Improving the camera
Pushing Pierre forward
Checkpoint 4-B
Summary
Chapter 5: Spawning Enemies, Coins, and Power-ups
Introducing the cast
Organizing the project navigator
Testing the new game objects
Checkpoint 5-A
Summary
Chapter 6: Generating a Never-Ending World
Designing levels with the SpriteKit scene editor
Encounters in endless flying
Integrating scenes into the game
Checkpoint 6-A
Spawning endless encounters
Spawning the star power-up at random
Checkpoint 6-B
Summary
Chapter 7: Implementing Collision Events
Learning the SpriteKit collision vocabulary
Adding contact events to our game
Checkpoint 7-A
Player health and damage
Collecting coins
The power-up star logic
Checkpoint 7-B
Summary
Chapter 8: Polishing to a Shine – HUD, Parallax Backgrounds, Particles, and More
Adding a heads-up display
Parallax background layers
Checkpoint 8-A
Harnessing SpriteKit's particle system
Granting safety as the game starts
Checkpoint 8-B
Summary
Chapter 9: Adding Menus and Sounds
Building the main menu
Adding the restart game menu
Checkpoint 9-A
Adding music and sound
Checkpoint 9-B
Summary
Chapter 10: Integrating with Game Center
Registering an app with iTunes Connect
Authenticating the player's Game Center account
Opening Game Center in our game
Checkpoint 10-A
Adding a leaderboard of high scores
Adding an achievement
Checkpoint 10-B
Summary
Chapter 11: Ship It! Preparing for the App Store and Publication
Finalizing assets
Finalizing iTunes Connect information
Uploading our project from Xcode
Submitting for review in iTunes Connect
Summary

Book Details

ISBN 139781783550531
Paperback224 pages
Read More
From 1 reviews

Read More Reviews