Making Simple 2D Game using Cocos2d-x
Session01
Cocos2d-x Introduction and Configuration
Cocos2d-x is a suite of open-source, cross-platform, game-development tools written in C++. Cocos2d-x runs on top of OpenGL 2.0 and OpenGL ES 2.0. Cocos2d-x is one of the branch from Cocos2d open source software framework. Other branches of Cocos2d that have been used widely are Cocos2d-SpriteBuilder (later changed to Cocos Studio), Cocos2d-js (for coding using javascript), and SDKBOX (an integrated SDK to collaborate with 3rd parties SDKs). Why Cocos2d-x? It has several advantages which are: modern C++ API, cross platform, capability to test and debug your game on the desktop and then push it to a mobile or desktop target, and a vast API of functionality including sprites, actions, animations, particles, transitions, timers, events(touch, keyboard, accelerometer, mouse), sound, file IO, persistence, skeletal animations, 3D. These series of tutorials will discuss simple game development using Cocos2d-x with C++ programming language. The first tutorial will discuss the configuration of Cocos2d-x in Windows base.
- First thing first, the applications needed to be prepared are:
- Visual Studio 2013
- Cocos2d-x (http://www.cocos2d-x.org/download/)
- Python-2.7 (https://www.python.org/downloads/)
*Visual Studio and Python-2.7 can be installed as usual while Cocos2d-x only need to be extracted.
- Next, navigate to the folder where Cocos2d-x extracted and copy it in the command prompt using this command: cocos new -p [package name] -l cpp -d [directory] [project name]
- Open vcxproj file inside the project directory. In this example the path of vcxproj file is in S:\Cocos\Cocos01\proj.win32. The project loaded in Visual Studio will appeared like the picture below.
- Rebuild the project by right-click on the solution and choose “build solution”. The process may take a while. After the build process has finished, you may debug it and the result should be like this:
At this point, you have finished installing Cocos2d-x and run it using Visual Studio. In the next session, there will be discussions about basic programming using Cocos2d-x in Visual Studio.
source:
https://en.wikipedia.org/wiki/Cocos2d
http://www.cocos2d-x.org/
http://www.cocos2d-x.org/programmersguide/ProgrammersGuide.pdf