logo资料库

2D_Apple_Games_by_Tutorials_2.0.pdf

第1页 / 共671页
第2页 / 共671页
第3页 / 共671页
第4页 / 共671页
第5页 / 共671页
第6页 / 共671页
第7页 / 共671页
第8页 / 共671页
资料共671页,剩余部分请下载后查看
Table of Contents : Extended
Introduction
History of this book
About this book
iOS game development: a history
What you need
Who this book is for
How to use this book
What’s ahead: an overview
Section I: Getting started
Section II: Physics and nodes
Section III: Tile Maps
Section IV: Juice
Section V: Other Platforms
Section VI: Advanced Topics
Section VI: Bonus chapter
Book source code and forums
Book updates
License
Acknowledgements
Section I: Getting Started
Chapter 1: Sprites
Getting started
Displaying a sprite
Challenges
Chapter 2: Manual Movement
The SpriteKit game loop
Moving the zombie
Rotating the zombie
Challenges
Chapter 3: Actions
Move action
Sequence action
Wait-for-duration action
Run-block action
Reversing actions
Repeating actions
Periodic spawning
Remove-from-parent action
Animation action
Stopping action
Scale action
Rotate action
Group action
Collision detection
The SpriteKit game loop, round 2
Sound action
Sharing actions
Challenges
Chapter 4: Scenes
Win and lose conditions
Creating a new scene
Transitioning to a scene
Creating a custom scene initializer
Background music
Challenges
Chapter 5: Camera
Lights, camera, action!
A scrolling background
An endlessly scrolling background
Fixing the gameplay
Challenges
Challenge 1: Fixing the enemies
Chapter 6: Labels
Built-in fonts and font families
Adding a label to Zombie Conga
Alignment modes
Loading custom fonts
Updating the label text
Challenges
Section II: Physics and Nodes
Chapter 7: Scene Editor
Getting started
Getting started with the scene editor
File references
Animations and action references
More about the timeline
Challenges
Chapter 8: Beginning Physics
Physics in SpriteKit
Getting started
Your first playground
Creating a SpriteKit playground
Circular bodies
Edge loop bodies
Rectangular bodies
Custom-shaped bodies
Visualizing the bodies
Bodies with complex shapes
Properties of physics bodies
Applying an impulse
Challenges
Chapter 9: Intermediate Physics
Getting started
Custom node classes
Connecting sprites to variables
Adding physics
Introducing SKTUtils
Background music
Controlling your bodies
Finishing touches
Challenges
Chapter 10: Advanced Physics
Getting started
Introducing Level 2
Loading levels
Scene editor, round 2
An overview of Joints
Joints in use
The SpriteKit game loop, Round 4
An overview of Constraints
Creating and removing joints dynamically
Compound shapes
Level progression
Challenges
Chapter 11: Crop, Video, and Shape Nodes
Getting started
Crop nodes
Video nodes
Shape nodes
Challenges
Section III: Tile Maps
Chapter 12: Beginning Tile Maps
Getting started
Creating a tile set
Creating a tile map
Adjacency groups
Adding the player
Adding a camera
Player animations
Challenges
Chapter 13: Intermediate Tile Maps
Tile map classes
Replacing tiles with SKNodes
Physics categories
Obstacles and physics
Tile user data
Creating tile maps in code
Power-ups with tile maps
Breakables
Challenge: Add a breakable tree
Chapter 14: Saving and Loading Games
Head-up display
Game timers
Winning the game
Game state management
Changing levels
Scene user data
Opening and closing the app
Saving games with NSCoding
Loading the game
Cleaning up
Challenge
Section IV: Juice
Chapter 15: Making Drop Charge
Getting started
Building the game world in the scene editor
Writing the gameplay code
Game Over, man!
Challenges
Chapter 16: Particle Systems
Getting started
Programmatic particle systems
Visually-created particle systems
Challenges
Chapter 17: Juice Up Your Game
Getting started
Three steps for adding juice
Music and sound effects
Frame animation
Particle effects
Screen effects
Sprite effects
Finishing touches
Challenge
Where to go from here?
Section V: Other Platforms
Chapter 18: macOS Games
Cross-platform strategies
Creating platform targets
Creating a new target
Events
Scaling
Going deep
Challenge
Chapter 19: tvOS Games
Design considerations
Review
The remote
Finishing touches
Chapter 20: watchOS Games
Designing games for your wrist
Review
Gesture recognizers
Working with the Digital Crown
The accelerometer
Haptic feedback
Finishing touches
Where to go from here?
Section VI: Advanced Topics
Chapter 21: Game Center Achievements
Getting started
Introducing Game Center
Configuring your app to use Game Center
Authenticating local players
Adding achievements
Initializing the built-in user interface
Challenges
Chapter 22: Game Center Leaderboards
Getting started
Authenticating the local player
Creating a leaderboard strategy
Configuring leaderboards in iTunes Connect
Reporting scores to Game Center
Displaying leaderboards
Leaderboard sets
Security in Game Center
Challenges
Chapter 23: ReplayKit
Getting started
Integrating ReplayKit
Creating a recording strategy
Modifying the user interface
Checking for availability
Starting and stopping recordings
Previewing and sharing recordings
Where to go from here?
Challenges
Section VII: Bonus Section
Chapter 24: 2D Art for Programmers
Choose your path: Hire or DIY?
How to find and hire an artist
Paying your artist
Getting started
Begin with a sketch
Getting the sketch into Illustrator
Tracing the sketch with vector lines
Custom stroke widths
Coloring your artwork
A bit about shadow and light
Exporting PNG files
Challenges
Conclusion
2D iOS & tvOS Games by Tutorials 2D Apple Games by Tutorials Caroline Begbie, Mike Berg, Michael Briscoe, Ali Hafizji, Marin Todorov and Ray Wenderlich Copyright ©2016 Razeware LLC. Notice of Rights All rights reserved. No part of this book or corresponding materials (such as text, images, or source code) may be reproduced or distributed by any means without prior written permission of the copyright owner. Notice of Liability This book and all corresponding materials (such as source code) are provided on an “as is” basis, without warranty of any kind, express of implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in action of contract, tort or otherwise, arising from, out of or in connection with the software or the use of other dealing in the software. Trademarks All trademarks and registered trademarks appearing in this book are the property of their own respective owners. raywenderlich.com 2
2D iOS & tvOS Games by Tutorials Dedications "For my mum, who frequently challenges and always inspires me; also for Muffin, my patient and loyal puppy." — Caroline Begbie "To my wonderful wife and family, who make it possible to do what I do." — Mike Berg "To my father who ignited my love of computers. To my daughters Meghan and Brynne, and all six of my grandchildren. And to Lindsay for all the love and support." — Michael Briscoe "To my wife for always being supportive and to our bun in the oven, your parents await your arrival." — Kauserali Hafizji (a.k.a. Ali) "To my father." — Marin Todorov "To the authors, editors and leads at raywenderlich.com. Teamwork lets you dream bigger!" — Ray Wenderlich raywenderlich.com 3
2D iOS & tvOS Games by Tutorials About the authors Caroline Begbie is living the dream as an indie iOS developer, educator and explorer. She loves the graphics and animation side of iOS and watches Disney movies "for research." Mike Berg is a full time game artist who is fortunate enough to work with many different indie game developers from all over the world. When he’s not manipulating pixel colors, he loves to eat good food, spend time with his family, play games and be happy. Michael Briscoe is an independent software developer with over 30 years of programming experience. Learning BASIC on a Commodore 64 way back in 1984, he’s been hooked on coding ever since. He enjoys creating simulations and games for all Apple platforms. You can visit his website at skyrocketsoftware.wordpress.com. Kauserali Hafizji (a.k.a. Ali) is a freelance software developer. He is fortunate to have worked on several large projects. He loves creating software that people use everyday whether it's on the web, watch, phone or tv. A good read, cool dip in the pool and a hot cheesy meal would be the perfect end to his weekend. You can find out more about Ali on his website at: alihafizji.com. Marin Todorov is a part of Realm and raywenderlich.com. He’s also the author of books and apps. You can find out more at www.underplot.com. Ray Wenderlich is part of a great team — the raywenderlich.com team, a group of over 100 developers and editors from across the world. He and the rest of the team are passionate both about making apps and teaching others the techniques to make them. When Ray’s not programming, he’s probably playing video games, role playing games, or board games. raywenderlich.com 4
2D iOS & tvOS Games by Tutorials About the editors Kyle Gorlick is the tech editor of this book. Kyle is a software developer currently focused on mobile apps and games. When not developing, he likes to watch basketball and play volleyball. You can learn more about him and what he’s working on at kylegorlick.com. Chris Belanger is the editor of this book. Chris is the Book Team Lead and Lead Editor for raywenderlich.com. If there are words to wrangle or a paragraph to ponder, he’s on the case. When he kicks back, you can usually find Chris with guitar in hand, looking for the nearest beach, or exploring the lakes and rivers in his part of the world in a canoe. Tammy Coron is the final pass editor of this book. Tammy is an independent creative professional and the host of two podcasts — Roundabout: Creative Chaos and Invisible Red. She’s also the founder of Just Write Code, a small independent production company based in West Tennessee. Find out more at tammycoron.com. About the artists Mike Berg created the artwork for most of the games in this book. Mike is a full time game artist who is fortunate enough to work with many different indie game developers from all over the world. When he’s not manipulating pixel colors, he loves to eat good food, spend time with his family, play games and be happy. Vinnie Prabhu created all the music and sounds for the games in this book. Vinnie is a music composer/software engineer from Northern Virginia who has created music and sound work for concerts, plays and video games. He’s also a staff member on OverClocked ReMix, an online community for music and video game fans. You can find Vinnie on Twitter as @palpablevt. raywenderlich.com 5
2D iOS & tvOS Games by Tutorials Vicki Wenderlich created many of the illustrations in this book and the artwork for Drop Charge. Vicki is Ray’s wife and business partner. She is a digital artist who creates illustrations, game art and a lot of other art or design work for the tutorials and books on raywenderlich.com. She also runs gameartguppy.com, which is a website where she creates free and inexpensive art assets for game developers to use in their games. When she’s not making art, she loves hiking, a good glass of wine and attempting to create the perfect cheese plate. raywenderlich.com 6
2D iOS & tvOS Games by Tutorials Section II: Physics and Nodes Table of Contents: Overview Introduction Section I: Getting Started Chapter 1: Sprites Chapter 2: Manual Movement Chapter 3: Actions Chapter 4: Scenes Chapter 5: Camera Chapter 6: Labels ................................................................................ .............................................. ........................................................... ...................................... ........................................................... ......................................................... ...................................................... ......................................................... .................................... .............................................. ...................................... ................................ .................................. ......... .................................................. .............................. ........................ ................ ......................................................... ............................ ..................................... Chapter 7: Scene Editor Chapter 8: Beginning Physics Chapter 9: Intermediate Physics Chapter 10: Advanced Physics Chapter 11: Crop, Video, and Shape Nodes 16 31 32 55 82 112 123 134 149 150 178 206 241 279 308 309 340 368 399 400 440 Section III: Tile Maps Chapter 12: Beginning Tile Maps Chapter 13: Intermediate Tile Maps Chapter 14: Saving and Loading Games Section IV: Juice Chapter 15: Making Drop Charge Chapter 16: Particle Systems raywenderlich.com 7
2D iOS & tvOS Games by Tutorials Section VI: Advanced Topics Chapter 17: Juice Up Your Game Section V: Other Platforms Chapter 18: macOS Games Chapter 19: tvOS Games Chapter 20: watchOS Games ............................. ......................................... ....................................... ........................................... .................................... ...................................... ................ ............... ................................................. .......................................... ...................... ............................................................................... Chapter 21: Game Center Achievements Chapter 22: Game Center Leaderboards Chapter 23: ReplayKit Section VII: Bonus Section Chapter 24: 2D Art for Programmers Conclusion 468 498 499 521 536 558 559 583 600 624 625 671 raywenderlich.com 8
分享到:
收藏