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

Porting a project to Android

We will port the Swift project we created in the last chapter to Android.

The process of creating the project in SpriteBuilder is the same as in Swift; however, obviously, this time, the code needs to be in Objective-C.

How to do it…

Once the project is created in SpriteBuilder, we can open the project in Xcode 6.1.1 and even run the project to make sure there are no build errors.

The built project should run on our device as shown in the following screenshot:

How to do it…

Now, as in the Swift project, we have to create a Rocket class. So, we create a new class called Rocket. The Rocket.h and Rocket.m files should look similar to the ...

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