This is a simple game created using the Cocos2d-x C++ framework.
This is a simple game about a bunny that has to catch the carrots and avoid the bombs. With this simple example you'll get some snippets that would help you with:
- Cocos2d-x Physics
- Transitions between Scenes
- True Type Fonts
- Bitmap Fonts
- Handling touch events
- Playing , pausing and changing audio volume
- Sprite handling
- Cocos2d-x Schedulers
- Use the accelerometer
Cocos2d-x is a game development framework that supports C++, javascript or lua for creating 2D and 3D games.
This framework allows you to deploy in the following platforms using the same codebase:
- Android
- iOS (iPhone and iPad)
- Windows (win32 , win 8.1 and win 10)
- Linux
- Mac OS
- Tizen
- QNX BlackBerry X (Only branch 2 of Cocos2d-x)
In order to build this code you will need to follow these steps:
- Download the latest Cocos2d-x version
- Extract the zip file
- Execute the
setup.py
script (Make sure taht you have Python 2.7 installed on your system) - Restart the console
- Execute the
download-deps.py
script 6- Execute theinstall-deps-linux.sh
script - Create a new Cocos Project executing the following command:
cocos new HappyBunny -p com.yourname.happybunny -l cpp -d ./projects
- Copy the ./projects/HappyBunny/cocos2d folder into the directory where you have cloned this repo
- Execute
cocos build -p linux
Once you have followed the steps described in the previous sections you will need to execute the following command in order to execute the game:
cocos run -p linux
If you are interested in Cocos2d-x C++ game development take a look at the book that I wrote about it
If you have any comment feel free to contact me:
Raydelto Hernandez [email protected]