Learning Cocos2d-x Game Development
上QQ阅读APP看书,第一时间看更新

Chapter 1. Getting Started

In this chapter, we will look at the basics of the Cocos2d-x frameworks and get the required tools installed to create the Cocos2d-x project. This will include downloading and installing Visual Studio IDE, Windows Phone SDK, Python, and Cocos2d-x and creating the project. We will also cover some basics such as coordinate systems, fundamental classes of Cocos2d-x, and how to run the same project on different devices running on different platforms.

The topics you will learn in this chapter are as follows:

  • Downloading and installing Visual Studio
  • Downloading and installing Windows Phone SDK
  • Downloading, installing, and configuring Python
  • Downloading Cocos2d-x
  • Creating your project and running it on a simulator
  • The basics of Cocos2d-x, the coordinate system, and project structure
  • Running the project on multiple platforms

The following are the requirements to get started:

  • Windows 8.0 (64-bit)
  • Visual Studio 2012 Express Edition
  • Windows Phone SDK 8.0
  • Python Version 2.7.6
  • Cocos2d-x Version 2.2.3

At the time of writing this book, Version 3.0 of Cocos2d-x had already been released. I am using Version 2.2.3 for this book for the following reasons:

  • Version 2.2.3 supports a wide array of platforms such as Blackberry, Windows Phone, Tizen, and Marmalade
  • There are a lot of tools that are freely available for Version 2.2.3 for advertisements, in-app purchases, and leaderboard and achievement integration, which in v3.0 you would have to write yourself at the moment

That being said, I would definitely keep a watch on v3.0 and the platforms it supports in the future releases. Also, the tools are being updated to support Version 3.0. I would recommend downloading v3.0 from the site and practicing with it once you have a good understanding of how Cocos2d-x works.

Note

If you wish to run the game on iOS, Android, or Blackberry instead of Windows Phone 8, you can refer to Chapter 11, Porting, References, and Final Remarks, and see how to configure the IDE for that OS and then continue from the next chapter.

For Win32, you can continue with this chapter and you wouldn't have to install Windows Phone 8 SDK. You can also run the project on Windows 7 or higher machines, but you will have to make a small change in the AppDelegate.cpp file, which is mentioned in Chapter 11, Porting, References, and Final Remarks.

Also, while opening the win32 project developed in Visual Studio 2012 with the currently installed Visual Studio 2013, you might get some errors. The following are the steps to be taken to fix this:

  1. Right-click on the wp8GameComponent project and then click on Properties.
  2. In General under Configuration Properties, make sure Windows Phone 8.0 (V110) is selected for Platform Toolset.

    Note

    Cocos2d-x 2.2.3 can be downloaded for all the OSes from the links in this chapter.