Presentation Outline
What are gaming engines ? Cocos2D Origins Cocos2D for Android Developing Games using Cocos2D Android Cocos2D Android Test Environment Setup (Windows) Setting up a Sample Game (Puzzlemania) Puzzlemania Components Conclusion
Cocos 2D Origins
Cocos2d is an open source framework for building 2D games, demos, and other graphical/interactive applications. Originally developed using python, some of its main features include : Flow control: Manage the flow control between different scenes in an easy way Sprites: Fast and easy sprites Actions: Just tell sprites what you want them to do. Composable actions like move, rotate, scale and much more Effects: Effects like waves, twirl, lens and much more Other features include Tiled Maps, Transitions, Menus ,Text Rendering , OpenGL based and aBuilt-in Python Interpreter
In order to start creating cool games using the Cocos2D gaming engine, you need to download the .jar library (cocos2d-android.jar) and compile your android project using it as a referenced library. The next section provides steps on setting up a test environment and developing a simple game.
1.) Download the cocos2d-android library. The cocos2D android project is managed here (http://code.google.com/p/cocos2d-android-1/) and the source code as well as cocos2d-android.jar can be downloaded at the following github account (https://github.com/ZhouWeikuan/cocos2d) via the downloads button. 2.) Download Eclipse IDE for Java Developers (http://www.eclipse.org/downloads/) Extract the downloaded zip file and run eclipse.exe to launch the IDE. No installations required. 3.) Install Android SDK for Windows. Download and extract the android sdk here (http://dl.google.com/android/android-sdk_r12-windows.zip) For easy access, the preferred extraction location is C:/android-sdkwindows.
Puzzlemania Screenshot
Puzzlemania Components
Puzzle.java Main logic that controls game play, timing, tile animation and difficulty selection Utility.java Generates puzzle number sequence such that the puzzle is ALWAYS solvable CCNodeExt.java A special node object used to model each tile.
A possible extension of puzzlemania would be to develop an image slider puzzle in contrast to the current number slider puzzle.
Conclusion
Cocos2D is a powerful game engine as evidenced by notable games on the iphone platform [4] . A great way to proceed in getting familiarized with the Cocos2D engine and game development is to attempt to develop mobile versions of simple games we played as children (Ludo, snakes and ladders and other local games).
References
1.
2.
3.
4.
Cocos2d for Android Github Project https://github.com/ZhouWeikuan/cocos2d Retrieved March 1, 2012 Installing the Android Developer Tools (ADT) Plugin http://developer.android.com/sdk/eclipseadt.html#installing. Retrieved March 2, 2012 Using Hardware Devices http://developer.android.com/guide/developing/dev ice.html. Retrieved March 3, 2012 Games Using the Cocos2D for iPhone http://code.google.com/p/cocos2diphone/wiki/GamesUsingCocos2d . Retrieved March 1, 2012