O'Reilly logo

Learn cocos2d 2: Game Development for iOS by Andreas Löw, Steffen Itterheim

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    7

Scrolling with Joy

Continuing with the beginnings of the game from Chapter 6, you’ll now turn it into something resembling an actual shoot-’em-up game. The very first thing will be to make the player’s ship controllable. Accelerometer controls don’t make sense in this case; a virtual joypad would be much more appropriate. But instead of reinventing the wheel, you’ll use a cool source code package called SneakyInput to add a virtual joypad to this cocos2d game.

Moving the player’s ship around is one thing. You also want the background to scroll, to give the impression of moving into a certain direction. To make that happen, you’ll implement your own solution for parallax scrolling, because CCParallaxNode is too limited—it doesn’t ...

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