cocos2d-x README

The project's README from github.com/cocos2d/cocos2d-x. As one markdown file: README.md.

cocos2d-x

Win32 Others
Build status Build Status

cocos2d-x is a multi-platform framework for building 2d games, interactive books, demos and other graphical applications. It is based on cocos2d-iphone, but instead of using Objective-C, it uses C++. It works on iOS, Android, macOS, Windows and Linux.

Cocos2d-x Framework Architecture:

cocos2d-x is:

Git user attention

  1. Clone the repo from GitHub.

      $ git clone https://github.com/cocos2d/cocos2d-x.git
    
  2. After cloning the repo, please execute download-deps.py to download and install dependencies.

      $ cd cocos2d-x
      cocos2d-x $ python download-deps.py
    
  3. After running download-deps.py.

      cocos2d-x $ git submodule update --init
    

Download stable versions

Documentations and samples

Main features

Build Requirements

Runtime Requirements

Environment Setup

Should set up environment before starting a new game or running tests

$ cd cocos2d-x
$ ./setup.py
$ source FILE_TO_SAVE_SYSTEM_VARIABLE

Should invoke this script if using linux system

$ cd cocos2d-x
$ ./install-linux-deps.sh

Running Tests

$ cd cocos2d-x
$ mkdir build
$ cd build
$ cocos run --proj-dir .. -p [mac|win32|android|linux|ios]

How to start a new game

$ cd cocos2d-x
$ ./setup.py
$ source FILE_TO_SAVE_SYSTEM_VARIABLE
$ cocos new MyGame -p com.your_company.mygame -l cpp -d NEW_PROJECTS_DIR
$ cd NEW_PROJECTS_DIR/MyGame
$ mkdir build
$ cd build
$ cocos run --proj-dir .. -p [mac|win32|android|linux|ios]

You can also create a Lua project with -l lua.

Using IDE

If need to debug program, then it is more convinent to use IDE to run and debug it. All platforms other than Android can use CMake to generate corresponding project file. Can refer to Detail CMake Guide for detail information.

For Android, the Android Studio project file lies in PROJECT_DIR/proj.android. Can just use Android Studio to import the exsting project file.

Learning Resources

Spreading the word!

You can help us spread the word about cocos2d-x! We would surely appreciate it!

Where to get help

Contributing to the Project

Cocos2d-x is licensed under the MIT License. We welcome participation!

Did you find a bug? Do you have feature request? Do you want to merge a feature?

Embrace the Future: Switch to Cocos Creator for a Better Experience

Cocos Creator is the new generation of Cocos game engine with a full featured editor and content creation friendly workflow. It supports all major platforms allowing games to be quickly released for the web, iOS, Android, Windows, Mac, and various mini-game platforms. Millions of developers have built 2D / 3D experiences, from hardcore games to web instant entertainment. A pure JavaScript-developed engine runtime is available on the web and mini-game platforms for better performance and smaller packages. On other native platforms, C++ is used to implement the underlying framework, providing greater operational efficiency. The engine is completely open source, and retains the advantages of Cocos2d-x which includes high performance, customizability, ease for debugging, easy to learn, and small package size.

Therefore, we no longer recommend new users to start with Cocos2d-x. Instead, please use the brand-new Cocos Creator for project development to enjoy the best editor and 3D support.

cocos2d-x (cocos2d/cocos2d-x)

Searching Database…

19.2K ·GitHub
Что это такое?Опенсорсный кроссплатформенный C++-фреймворк для создания 2D-игр, интерактивных книг, демо и других графических приложений — он начинался как C++-порт cocos2d-iphone и работает на iOS, Android, macOS, Windows и Linux.
Это полноценный игровой движок или низкоуровневая библиотека, из которой я всё соберу сам?Полноценный 2D-движок: управление сценами с переходами между ними, спрайты и спрайт-листы, система действий и плавных анимаций (easing), простые меню и кнопки, тайловые карты, параллакс-скроллинг и звуковой движок. Игра строится как набор сцен.
Как запустить свою первую игру?Склонируйте репозиторий, выполните 'python download-deps.py' и 'git submodule update --init', затем './setup.py'. Создайте проект командой 'cocos new MyGame -p com.yourcompany.mygame -l cpp -d NEWPROJECTSDIR' и запустите его через 'cocos run --proj-dir .. -p mac'.
Что должно быть установлено на моём компьютере, чтобы всё это заработало?Python 2.7.5+ — в README прямо сказано, что Python 3 не подходит. По платформам: Xcode 8+ на macOS, VS 2015 на Windows, CMake 3.1+ на Linux; для Android нужны NDK r16+ и Android Studio 3.0.0+, а для публикации веб-версий — JRE или JDK 1.6+.
Есть ли подвох, о котором стоит знать, прежде чем тратить на это время?Сам README уже не рекомендует начинать новые проекты на cocos2d-x — команда отправляет новичков к Cocos Creator, а у этих двух движков разные наборы API, так что знания напрямую не перенесутся.
Где будет работать моя готовая игра?Согласно системным требованиям: iOS 8.0+, Android 3.0.0+, OS X v10.9+ и Windows 7+. Сама разработка поддерживается на macOS, Windows и Linux (Ubuntu 14.04+).
Могу ли я выпустить проприетарную коммерческую игру на нём?Да — Cocos2d-x распространяется по лицензии MIT и открыто позиционируется как дружелюбная к коммерции, совместимая как с открытыми, так и с закрытыми проектами.
Какие физические движки можно использовать в моей игре?Box2d и Chipmunk встроены из коробки, кроме того есть встроенная система частиц и поддержка скелетной анимации через Spine и Armature.
С помощью чего происходит рендеринг внутри?OpenGL ES 2.0 на мобильных платформах, OpenGL 2.1 на настольных и Metal на macOS и iOS.
Как cocos2d-x связан с Cocos Creator?Ядро cocos2d-x легло в основу Cocos Creator 1.x и 2.x; Creator — это более новый движок с редактором и поддержкой 3D, а cocos2d-x остаётся классическим C++-движком, где всё пишется кодом.
What are similar projects?bgfx, flame, assimp, luanti, JoltPhysics, ebiten, imgui, libgdx
Creator
cocos2d
Size
1 GB
Stars
19.2K
Updated
CommitNov 20
Age
15y
Commits · 90 Days