O'Reilly logo

iOS Game Programming with Xcode and Cocos2d by Justin Dike

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 6

Accelerometer and Actions

 

 

 

Your test device is probably covered in smudges from all that heartfelt touching in the last chapter. The first thing we'll look at this chapter is using the Accelerometer, which is one of the coolest ways of touch-free interaction with your device. So give your iPad a good wipe down and it should stay that way for a bit.

We'll also spend a long time looking into CCAction classes, which are typically just a couple lines of code that handle animating things like fades, movements, rotations, and even special effects similar to the Filters in Photoshop. Actions can also be composed together to play through a sequence or repeat endlessly. The best part is that they are incredibly easy to set up, so all you ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required