Skip to Main Content
Learn Sprite Kit for iOS Game Development
book

Learn Sprite Kit for iOS Game Development

by Leland Long
June 2014
Beginner content levelBeginner
256 pages
5h 38m
English
Apress
Content preview from Learn Sprite Kit for iOS Game Development

Chapter     3

Sprite Movement Responding to User Inputs

Run Away!

So far, once the game screen is presented (initially with a solid black background), an animated sprite appears on the screen when the user taps the screen. That’s all well and good, but you’ve only just begun. Now you’ll add some movement!

First, you’ll see how to add code to detect where the user has tapped and split the screen into two zones of interest: a left zone and a right zone. When the user taps inside the left zone, you’ll make the sprite move to the left, and as you would expect. When the user taps inside the right zone, you’ll make the sprite move to the right. You’ll determine the left and right zones in the code by taking the game screen area and dividing it by two. ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Build iOS Games with Sprite Kit

Build iOS Games with Sprite Kit

Jonathan Penn, Josh Smith
Beginning Swift Games Development for iOS

Beginning Swift Games Development for iOS

James Goodwill, Wesley Matlock
Objective-C for Absolute Beginners: iPhone, iPad and Mac Programming Made Easy

Objective-C for Absolute Beginners: iPhone, iPad and Mac Programming Made Easy

Stefan Kaczmarek, Brad Lees, Gary Bennett, Mitch Fisher

Publisher Resources

ISBN: 9781430264408Purchase book