官术网_书友最值得收藏!

Downloading and installing Cocos2d

To create and run a Cocos2d project, you have to install SpriteBuilder and Xcode. In this section, we will briefly cover how to do so.

Getting ready

To download and install Cocos2d, go to http://cocos2d.spritebuilder.com/download.

SpriteBuilder is the official installer of Cocos2d now. To install, click on the Cocos2d-SpriteBuilder installer link. This will open the Mac App Store Preview page.

If you would like to download an older version of Cocos2d, you can go through the links in the archive section of the page and download it from there as well.

Click on the View in Mac App Store link and then click on Launch Application when prompted.

Once the App Store opens, click on Install to start the installation process. You will need to sign in to an account to download the file.

Once installed, it should be in your applications folder. Open up Launchpad and click on the application to open it.

Once the application starts, you will be asked to join the SpriteBuilder mailing list. Add your e-mail address and click on Continue or select Sign Up Later.

We will go through how to create a small project using SpriteBuilder later in the book. For now, we are ready to create a new project to work with. Navigate to File | New Project and select a location to create the project folder.

You can also select the primary language for coding. As we will use Objective-C, make sure that it is selected at the bottom.

Once you have selected the location for the project, in the Save As box at the top, give the project a name. Remember the name and the location of the project folder as we will need it to open the project in Xcode.

Next, we need to open the project in Xcode. We will first understand how to code using Xcode as it is essential to make more complex games. In later chapters, we will consider how to use SpriteBuilder to simplify our game development process.

You can close the SpriteBuilder project as it is not required anymore.

If you don't have Xcode, you can download it from the Mac App Store.

The installation process is very similar to any other app.

How to do it…

Perform the following steps:

  1. Once you install Xcode, go the to the project folder in the directory you stored the project in and double-click on projectname.xcodeproj. Here, I named the project Sprite, so I will double-click on Sprite.xcodeproj:
  2. Once it is open, you should see the interface as follows:

How it works…

Click on the play button in the upper-left corner to run the project.

This will run and show the default project running on the simulator. Congrats! You have Cocos2d running successfully.

主站蜘蛛池模板: 普格县| 普兰店市| 沐川县| 镇雄县| 蒙自县| 武威市| 吉林市| 铜陵市| 海丰县| 浦东新区| 盖州市| 南平市| 鹤峰县| 司法| 阳山县| 仙游县| 高清| 胶州市| 新建县| 新郑市| 广宁县| 炎陵县| 德保县| 秦皇岛市| 广饶县| 威海市| 西充县| 高台县| 察哈| 精河县| 九龙城区| 稷山县| 广州市| 巴塘县| 海淀区| 东台市| 乳山市| 保定市| 中卫市| 荃湾区| 柘荣县|