Swift 3 Game Development - Second Edition
图书信息
| 作者 | Stephen Haney |
| 出版社 | Packt Publishing |
| ISBN | 9781787122420 |
| 出版时间 | 2017-02-01 |
| 字数 | 78.4万 |
| 分类 | 进口书,外文原版书,电脑,网络 |
读书简介
Embrace the mobile gaming revolution by creating popular iOS games with Swift 3.0 About This Book Create and design games for iPhone and iPad using SpriteKit and Swift 3.0 Learn the core fundamentals of SpriteKit game development and mix and match techniques to customize your game This step-by-step practical guide will teach you to build games from scratch using little-known tips and strategies for maximum fun Who This Book Is For If you wish to create and publish fun iOS games using Swift, then this book is for you. You should be familiar with basic programming concepts. However, no prior game development or Apple ecosystem experience is required. What You Will Learn Deliver powerful graphics, physics, and sound in your game by using SpriteKit Set up the scene using the new capabilities of the scene editor and custom classes Maximize gameplay with little-known tips and strategies for fun and repeatable action Make use of animations, graphics, and particles to polish your game Understand the current mobile monetization landscape to choose the best option for your own situation Integrate your game with Game Center so that your players can share their high scores and achievements Publish your game to the App Store and enjoy people playing your games In Detail Swift is the perfect choice for game development. Developers are intrigued by Swift 3.0 and want to make use of new features to develop their best games yet. Packed with best practices and easy-to-use examples, this book leads you step by step through the development of your first Swift game. This book starts by introducing SpriteKit and Swift's new features that can be used for game development. After setting up your first Swift project, you will build your first custom class, learn how to draw and animate your game, and add physics simulations. Then, you will add the player character, NPCs, and powerups. To make your game more fun and engaging, you will learn how to set up scenes and backgrounds, build fun menus, and integrate with Apple Game Center to add leaderboards and achievements. You will then make your game stand out by adding animations when game objects collide, and incorporate proven techniques such as the advanced particle system and graphics. Finally, you will explore the various options available to start down the path towards monetization and 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. Style and approach This project-based guide is engaging with a visually-rich approach rather than a text-heavy approach. With every chapter containing practical examples, you will understand how Swift programming works and make the most of the new features in version 3.0.
目录
Swift 3 Game Development - Second Edition
Swift 3 Game Development - Second Edition
Credits
About the Author
About the Reviewer
www.PacktPub.com
Why subscribe?
Customer Feedback
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. Designing Games with Swift
Why you will love Swift
Prerequisites
What you will learn in this book
Embracing SpriteKit
Reacting to player input
Structuring your game code
Building UI/menus/levels
Integrating with Game Center
Maximizing fun
Crossing the finish line
Monetizing your work
New in Swift 3
Setting up your development environment
Introducing and installing Xcode
Creating our first Swift game
Navigating our project
Exploring the SpriteKit demo
Examining the demo code
Cleaning up
Summary
2. Sprites, Camera, Action!
Sharpening our pencils
Checkpoint 2-A
Drawing your first sprite
Building a SKSpriteNode class
Adding animation to your toolkit
Sequencing multiple animations
Recapping your first sprite
The story on positioning
Alignment with anchor points
Adding textures and game art
Downloading the free assets
More exceptional art
Drawing your first textured sprite
Adding the bee image to your project
Loading images with SKSpriteNode
Designing for retina
The ideal asset approach
Hands-on with retina in SpriteKit
Organizing your assets
Exploring Assets.xcassets
Collecting art into texture atlases
Updating our bee node to use the texture atlas
Iterating through texture atlas frames
Putting it all together
Centering the camera on a sprite
Checkpoint 2-B
Summary
3. Mix in the Physics
Laying the foundation
Following protocol
Reinventing the bee
The icy tundra
Adding the ground texture to Assets.xcassets
Adding the Ground class
Tiling a texture
Running wire to the ground
A wild penguin appears!
Renovating the GameScene class
Exploring the physics system
Dropping like flies
Solidifying the ground
Checkpoint 3-A
Exploring physics simulation mechanics
Bee meets bee
Impulse or force?
Checkpoint 3-B
Summary
4. Adding Controls
Retrofitting the Player class for flight
The Beekeeper
Updating the Player class
Moving the ground
Assigning a physics body to the player
Creating a physics body shape from a texture
Polling for device movement with Core Motion
Implementing the Core Motion code
Checkpoint 4-A
Wiring up the sprite onTap events
Implementing touchesBegan in the GameScene
Larger than life
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
Looping the ground
Checkpoint 4-B
Summary
5. Spawning Enemies, Coins, and Power-ups
Introducing the cast
Locating and adding the art assets
Adding the Power-up Star
Adding the Star class
Adding a new enemy - the Mad Fly
Adding the MadFly class
Another terror - Bats!
Adding the Bat class
Guarding the ground - adding the Blade
Adding the Blade class
Adding the coins
Creating the coin classes
Organizing the project navigator
Testing the new game objects
Checkpoint 5-A
Preparing for endless flight
Summary
6. Generating a Never-Ending World
Designing levels with the SpriteKit scene editor
Separating level data from game logic
Using custom classes in the scene editor
Encounters in endless flying
Creating our first encounter
Integrating scenes into the game
Checkpoint 6-A
Spawning endless encounters
Building more encounters
Updating the EncounterManager class
Storing metadata in SKSpriteNodeuserData property
Wiring up EncounterManager in the GameScene class
Spawning the Power-up Star at random
Turning bronze coins to gold
Checkpoint 6-B
Summary
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
Setting up the physics categories
Assigning categories to game objects
The player
The ground
The Power-up Star
Enemies
Coins
Preparing GameScene for contact events
Viewing console output
Testing our contact code
Checkpoint 7-A
Player health and damage
Animations for damage and game over
The damage animation
The game over animation
Collecting coins
The Power-up Star logicterrific progress in this chapter. To download my project up to this
Checkpoint 7-B
Summary
8. Polishing to a Shine - HUD, Parallax Backgrounds, Particles, and More
Adding a HUD
Implementing the HUD
Parallax background layers
Adding the background assets
Implementing a background class
Wiring up backgrounds in the GameScene class
Checkpoint 8-A
Harnessing SpriteKit's particle system
Adding the circle particle asset
Creating a SpriteKit particle file
Configuring the path particle settings
Adding the particle emitter to the game
Granting safety as the game starts
Checkpoint 8-B
Summary
9. Adding Menus and Sounds
Building the main menu
Creating the menu scene and menu nodes
Launching the main menu when the game starts
Wiring up the START GAME button
Adding the restart game menu
Extending the HUD
Wiring up GameScene for game over
Informing the GameScene class when the player dies
Implementing touch events for the restart menu
Checkpoint 9-A
Adding music and sound
Adding the sound assets to the game
Playing background music
Playing sound effects
Adding the coin sound effect to the Coin class
Adding the power-up and hurt sound effects to the Player class
Playing a sound when the game starts
Checkpoint 9-B
Summary
10. Standing Out in the Crowd with Advanced Features
Adding fun crates to smash open
Creating the Crate particle effects
Recycling emitter nodes with particle pools
Checkpoint 10-A
Wiring up crate contact events
Adding a health crate
Smashing coin crates
Checkpoint 10-B
Summary
11. Choosing a Monetization Strategy
Developing your marketing plan
When to start marketing
Marketing checklist
Leveraging crowdfunding
Pros and cons of crowdfunding
Showing display ads for revenue
The upsides to showing ads
The downsides to showing ads
Selling in-app purchases
In-app purchase strategies
A word about farming your players
Localization into foreign markets
Managing scope and completing projects
Summary
12. Integrating with Game Center
Registering an app with iTunes Connect
Creating a test user
Authenticating the player's Game Center account
Opening Game Center in our game
Checkpoint 10-A
Adding a leaderboard of high scores
Creating a new leaderboard in iTunes Connect
Updating the leaderboard from the code
Adding an achievement
Creating a new achievement in iTunes Connect
Updating achievements from the code
Checkpoint 10-B
Summary
13. Ship It! Preparing for the App Store and Publication
Finalizing assets
Adding app icons
Designing the launch screen
Taking screenshots for each supported device
Finalizing iTunes Connect information
Configuring pricing
Uploading our project from Xcode
Submitting for review in iTunes Connect
Summary
- 花鸟物语(谈正衡)
- 数据库原理与应用实训教程:SQL Server版(鲁艳霞)
- 2020年英文科技学术图书引证报告(上海交通大学)
- 杨红樱画本.校园童话系列(新版.全6册):爱玩飞镖的校长先生(杨红樱)
- 梅花易数((宋)邵雍撰)
- 九年级+中考-快捷英语周周练-完形填空(石骥)
- 智慧护理基本技能(夏立平,朱唯一)
- 老年人辅助器具应用(王文焕)
