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

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.

主站蜘蛛池模板: 香格里拉县| 邯郸市| 河北区| 宜丰县| 阿拉善左旗| 鞍山市| 延川县| 方正县| 荆门市| 曲周县| 贡山| 武胜县| 台中县| 庄浪县| 广水市| 六枝特区| 阜新市| 盘山县| 宜黄县| 嘉祥县| 庆安县| 政和县| 英山县| 东兴市| 漯河市| 通州区| 黑山县| 丹巴县| 天长市| 宿州市| 区。| 泾源县| 酒泉市| 德兴市| 吉林省| 温宿县| 舟山市| 常熟市| 达尔| 南充市| 凤阳县|