Cocos2d-x Integration with Skillz

Cocos2d-x is an open-source, cross-platform framework for 2d game development using C++. For more information on Cocos2d-x, see their documentation.

Why would you want to choose Cocos2d-x over other available game engines?

  • Modern C++ API (please refer to the modernizing done in version 3.0)
  • Cross-platform - desktop and mobile
  • Capability to test and debug your game on the desktop and then push it to a mobile or desktop target
  • A vast API of functionality including sprites, actions, animations, particles, transitions, timers, events (touch, keyboard, accelerometer, mouse), sound, file IO, persistence, skeletal animations, 3D

If your Cocos2d-x game’s activity must extend NativeActivity, please follow the below instructions to enable Skillz integration with your app.

Note: Recent versions of Cocos2d-x may require use of Activity instead of NativeActivity. If this applies to your application, then follow along the instructions but replace SkillzNativeActivity with SkillzActivity.

 

Step 1: For the activity class that inherits from NativeActivity, update this to inherit from SkillzNativeActivity instead.

Example:

public class EasyGameActivity extends NativeActivity {

}

Should be updated to:

public class EasyGameActivity extends SkillzNativeActivity {

}

Step 2: Update AndroidManifest activity names

In AndroidManifest.xml

  • Main activity should be the activity that inherits from SkillzNativeActivity.
  • The meta-data flag of skillz_game_activity should be the same as above.

Example:

<activity 
    android:name=".GameActivity"
</activity>


<meta-data android:name="skillz_game_id" android:value="4209" />
<meta-data android:name="skillz_production" android:value="true" />
<meta-data android:name="skillz_game_activity" android:value=".GameActivity" />
<meta-data android:name="skillz_allow_exit" android:value="true" />