O'Reilly logo

Cocos2d Cross-Platform Game Development Cookbook - Second Edition by Siddharth Shekar

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

Understanding swipe

When you press the screen, drag, and then take your finger off the screen in any particular direction, it is called a swipe gesture. To detect such gestures, there are in-built functions in iOS and Cocos2d that can be used.

Getting started

Before we start, it is better that we create a project and make the usual changes to the project so that it can load the MainScene class and select images based on prefix names instead of folder names. As we have already done this in the previous chapters, it is redundant to repeat it. If you have problems, you can refer to the previous chapter and learn it well as we will be creating at least one new project for each chapter in the book.

The MainScene.m file should look similar to the following: ...

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