Book description
Want to build games with iOS technologies? This cookbook provides detailed recipes for a wide range of common iOS game-development issues, ranging from 2D and 3D math to Game Center integration, and OpenGL to performance. If you’re familiar with iOS and Objective-C, this is the problem-solving guide you want.
Table of contents
- Preface
-
1. Laying Out a Game
- Laying Out Your Engine
- Creating an Inheritance-Based Game Layout
- Creating a Component-Based Game Layout
- Calculating Delta Times
- Detecting When the User Enters and Exits Your Game
- Updating Based on a Timer
- Updating Based on When the Screen Updates
- Pausing a Game
- Calculating Time Elapsed Since the Game Start
- Working with Blocks
- Writing a Method That Calls a Block
- Working with Operation Queues
- Performing a Task in the Future
- Storing Blocks in Objects
- Using a Timer
- Making Operations Depend on Each Other
- Filtering an Array with Blocks
- Loading New Assets During Gameplay
- Adding Unit Tests to Your Game
- 2D Grids
-
2. Views and Menus
- Working with Storyboards
- Creating View Controllers
- Using Segues to Move Between Screens
- Using Constraints to Lay Out Views
- Adding Images to Your Project
- Slicing Images for Use in Buttons
- Using UI Dynamics to Make Animated Views
- Moving an Image with Core Animation
- Rotating an Image
- Animating a Popping Effect on a View
- Theming UI Elements with UIAppearance
- Rotating a UIView in 3D
- Overlaying Menus on Top of Game Content
- Designing Effective Game Menus
-
3. Input
- Detecting When a View Is Touched
- Responding to Tap Gestures
- Dragging an Image Around the Screen
- Detecting Rotation Gestures
- Detecting Pinching Gestures
- Creating Custom Gestures
- Receiving Touches in Custom Areas of a View
- Detecting Shakes
- Detecting Device Tilt
- Getting the Compass Heading
- Accessing the User’s Location
- Calculating the User’s Speed
- Pinpointing the User’s Proximity to Landmarks
- Receiving Notifications When the User Changes Location
- Looking Up GPS Coordinates for a Street Address
- Looking Up Street Addresses from the User’s Location
- Using the Device as a Steering Wheel
- Detecting Magnets
- Utilizing Inputs to Improve Game Design
-
4. Sound
- Playing Sound with AVAudioPlayer
- Recording Sound with AVAudioRecorder
- Working with Multiple Audio Players
- Cross-Fading Between Tracks
- Synthesizing Speech
- Getting Information About What the iPod Is Playing
- Detecting When the Currently Playing Track Changes
- Controlling iPod Playback
- Allowing the User to Select Music
- Cooperating with Other Applications’ Audio
- Determining How to Best Use Sound in Your Game Design
-
5. Data Storage
- Saving the State of Your Game
- Storing High Scores Locally
- Using iCloud to Save Games
- Using the iCloud Key/Value Store
- Loading Structured Information
- Deciding When to Use Files or a Database
- Using SQLite for Storage
- Managing a Collection of Assets
- Storing Information in NSUserDefaults
- Implementing the Best Data Storage Strategy
- In-Game Currency
-
6. 2D Graphics and Sprite Kit
- Getting Familiar with 2D Math
- Creating a Sprite Kit View
- Creating a Scene
- Adding a Sprite
- Adding a Text Sprite
- Determining Available Fonts
- Including Custom Fonts
- Transitioning Between Scenes
- Moving Sprites and Labels Around
- Adding a Texture Sprite
- Creating Texture Atlases
- Using Shape Nodes
- Using Blending Modes
- Using Image Effects to Change the Way that Sprites Are Drawn
- Using Bézier Paths
- Creating Smoke, Fire, and Other Particle Effects
- Shaking the Screen
- Animating a Sprite
- Parallax Scrolling
- Creating Images Using Perlin Noise
-
7. Physics
- Reviewing Physics Terms and Definitions
- Adding Physics to Sprites
- Creating Static and Dynamic Objects
- Defining Collider Shapes
- Setting Velocities
- Working with Mass, Size, and Density
- Creating Walls in Your Scene
- Controlling Gravity
- Keeping Objects from Falling Over
- Controlling Time in Your Physics Simulation
- Detecting Collisions
- Finding Objects
- Working with Joints
- Working with Forces
- Adding Thrusters to Objects
- Creating Explosions
- Using Device Orientation to Control Gravity
- Dragging Objects Around
- Creating a Car
- 8. 3D Graphics
- 9. Intermediate 3D Graphics
- 10. Advanced 3D Graphics
-
11. Artificial Intelligence and Behavior
- Making an Object Move Toward a Position
- Making Things Follow a Path
- Making an Object Intercept a Moving Target
- Making an Object Flee When It’s in Trouble
- Making an Object Decide on a Target
- Making an Object Steer Toward a Point
- Making an Object Know Where to Take Cover
- Calculating a Path for an Object to Take
- Finding the Next Best Move for a Puzzle Game
- Determining if an Object Can See Another Object
- Using AI to Enhance Your Game Design
-
12. Networking and Social Media
- Using Game Center
- Getting Information About the Logged-in Player
- Getting Information About Other Players
- Making Leaderboards and Challenges with Game Center
- Finding People to Play with Using Game Center
- Using Bluetooth to Detect Nearby Game Players with the Multipeer Connectivity Framework
- Making Real-Time Gameplay Work with Game Kit and the Multipeer Connectivity Framework
- Creating, Destroying, and Synchronizing Objects on the Network
- Interpolating Object State
- Handling When a Player Disconnects and Rejoins
- Making Turn-Based Gameplay Work with GameKit
- Sharing Text and Images to Social Media Sites
- Implementing iOS Networking Effectively
- Implementing Social Networks Effectively
- 13. Game Controllers and External Screens
- 14. Performance and Debugging
- Index
- Colophon
- Copyright
Product information
- Title: iOS Game Development Cookbook
- Author(s):
- Release date: April 2014
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9781449368760
You might also like
book
iOS Game Development
The book offers information about the iOS platform. It explains the use of OpenGL ES for …
book
iOS Swift Game Development Cookbook, 2nd Edition
Ready to make amazing games for the iPhone, iPad, and iPod touch? With Apple’s Swift programming …
book
iOS Programming Cookbook
Over 50 exciting and powerful recipes to help you unearth the promise of iOS programming About …
book
Beginning Swift Games Development for iOS: Develop 2D and 3D games Using Apple's SceneKit and SpriteKit
Learn the fundamental elements of the new Swift 3 programming language as applied to game development …