How to start a new Cocos2d-x game for version 3.0

Source: Internet
Author: User

This documentation will show you how to use Cocos console to create and run a new project.

Runtime requirements
  • Android 2.3 +
  • IOS 5.0 +
  • OS X 10.7 +
  • Windows 7 +
  • Ubuntu 12.04 +
  • Cocos2d-x V3.0 +
Software requirements
  • Xcode 4.6 (for iOS or Mac)
  • GCC 4.7 For Linux or android. for Android ndk-r9 or newer is required.
  • Visual Studio 2012 (for Windows)
  • Python 2.7.5
Create a new project
$ cd cocos2d-x$ ./setup.py$ source ~/.bash_profile # may be ~/.bash_login or ~/.profile, depends on your environemnt$ cocos new MyGame -p com.MyCompany.MyGame -l cpp -d ~/MyCompany
  • MyGame: Name of your project
  • -p com.MyCompany.MyGame: Package name for Android
  • -l cpp: Programming language used for the project, valid value iscppAndlua
  • -d ~/MyCompany: Directory to hold your project

Folder structure of the generated project is as following:

(Note: The directory may be different when the project type is Lua .)

Build and run new project
$ cocos run -s ~/MyCompany/MyGame -p ios
  • -s: Directory of the new project. This cocould be an absolute path or a relative path.
  • -p: Which platform to run on. Options areios,android,win32,macAndlinux.

(Note: You are a tmux user, you shoshould addreattach-to-user-namespaceBefore the commandcocos. For more information, please refer to this link for more information .)

You can runcocos run --helpFor more detail information.

How to start a new Cocos2d-x game for version 3.0

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.