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 ...

Get Learn cocos2d 2: Game Development for iOS now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.