更新时间:2021-07-16 17:38:22
封面
Swift Game Development Third Edition
Why subscribe?
Packt.com
Contributors
About the authors
About the reviewer
Packt is Searching for Authors Like You
Preface
Who this book is for
What this book covers
To get the most out of this book
Get in touch
Chapter 1. Designing Games with Swift
Why you will love Swift
Prerequisites
What you will learn in this book
New in Swift 4.2
Setting up your development environment
Exploring the SpriteKit demo
Examining the demo code
Cleaning up
Summary
Chapter 2. Sprites Camera Action!
Preparing your project
Drawing your first sprite
Building a SKSpriteNode class
Animation—movement scaling and rotation
The story on positioning
Working with textures
Designing for Retina
Organizing art into texture atlases
Centering the camera on a sprite
Chapter 3. Mix in the Physics
Laying the foundations
Renovating the GameScene class
Physics bodies and gravity
Exploring physics simulation mechanics
Bumping bees into bees
Chapter 4. Adding Controls
Retrofitting the Player class for flight
Assigning a physics body to the player
Polling for device movement with Core Motion
Wiring up the sprite onTap events
Teaching our penguin to fly
Listening for touches in GameScene
Fine-tuning gravity
Spreading your wings
Improving the camera
Pushing Pierre forward
Tracking the player's progress
Chapter 5. Spawning Enemies Coins and Power-Ups
Introducing the cast
Locating and adding the art assets
Adding the Power-up Star
A new enemy - the Mad Fly
Another terror - Bats!
Guarding the ground with the Blade
Adding coins
Organizing the project navigator
Testing the new game objects
Preparing for endless flight
Chapter 6. Generating a Never-Ending World
Designing levels with the SpriteKit scene editor
Building encounters for Pierre Penguin
Looping encounters for a never-ending world
Adding the Power-up Star at random places
Turning bronze coins into gold coins
Chapter 7. Implementing Collision Events
Learning the SpriteKit collision vocabulary
Collision versus contact
Physics category masks
Using category masks in Swift
Adding contact events to our game
Assigning categories to game objects
Preparing GameScene for contact events
Viewing console output
Testing our contact code
Player health and damage
Animations for damage and game over
The Power-up Star logic
Chapter 8. Polishing to a Shine – HUD Parallax Backgrounds Particles and More
Adding a HUD
Parallax background layers
Using the particle system
Creating a SpriteKit particle file
Configuring the path particle settings
Adding the particle emitter to the game
Granting safety as the game starts
Chapter 9. Adding Menus and Sounds
Building the main menu
Wiring up the START GAME button
Wiring up GameScene for game over