How To Run Hello World   

/ / www.cocoachina.com/bbs/read.php?tid-15554.html). 

Ok, let's start to run the Hello World first.

Downloading and Installing cocos2d-x

The recommended IDE is Windows. Surpose you have installed WoPhone SDK and IDE (For UPhone SDK:http://sinaapp.csdn.net/up.zip, developer's community:http://110.86.4.110:8086/developmentWorks/).

Downloading Cocos2d-x Source Codes 

There are two ways to download the source codes:

First, download the archieve of the stable release here:  http://download.cocos2d-x.org.

Second, download the latest code here: http://github.com/cocos2d/cocos2d-x/. If you're not familiar with git, you could click the button "DOWNLOAD" on the right of page to download the latest code.

Then, unzip the archieve into the directory where WoPhone SDK lies: D:\Work7\cocos2d-x\. You'd better keep the directory structure as the follow picture to avoid the trouble of path configuration.

  How To Make A Simple WoPhone Game With Cocos2d-x : How To Run Hello World

We could find that cocos2d-x has completely ported the cocos2d engine, all the tests, box2d, chipmunk and cocosDenshion.

Double click cocosx-wophone.sln to start the solution with Visual Studio2008 or VS2010.(Don't click cocos2d-win32.sln by mistake.)

Installing the Template for Vs2008

Then enter

Hello, World

Ok, now we could see the Hello World scene. Follow the steps below.

First, set the HelloWorld project as the startup project:

How To Make A Simple WoPhone Game With Cocos2d-x : How To Run Hello World

Second, compile the HelloWorld project.

Third, start the WoPhone armulater. You can find the WoPhone Assistant icon at the right down corner of the screen, right click on the icon and start the armulater as follows:

How To Make A Simple WoPhone Game With Cocos2d-x : How To Run Hello World 

Fourth, run the HelloWorld project in VS2008, and the HelloWorld scene will be shown in the armulater.

How To Make A Simple WoPhone Game With Cocos2d-x : How To Run Hello World 

Now you should do some exercises, wry your neck to look at the armulater. Ok, everything is well except the landscape mode screen, but don't worry about this, the WoPhone team will make you enable to rotate the screen before long.

PS: There are two details in the above process:

First, we use the "Start" mode to start the armulatet instead of "Auto Start" mode, to get a simple and clean environment. In this mode, the system won't load the unneccessary programs that we don't need.

Second, the HelloWorld scene has a "X" button in the right-down corner, because not all the phones have a "HOME" button like iphone.

Creating a Template Project

For the simple game, we should create a new project to add our codes.

Follow this way,  solution -> Add -> New Project, choose the template "Cocos2d-WoPhone Application", and enter the project name you like at the botton, we use the name "SimpleGame" here.

How To Make A Simple WoPhone Game With Cocos2d-x : How To Run Hello World

Click "ok" button to enter the next form, and click "finish" button to finish the creation.

Then set the "SimpleGame" project as the startup project, build and run, you will see the result as hello world scene in the armulater.


相关文章:

  • 2022-12-23
  • 2022-02-14
  • 2022-12-23
  • 2021-08-04
  • 2021-11-22
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-06-03
  • 2021-10-08
  • 2022-01-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案