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

Time for action – viewing a sample project in the simulator

Let's take a look at the HelloPhysics sample project in the simulator:

  1. Click on Corona Simulator in the Corona SDK folder.
  2. Click on the Samples link on the Corona SDK window when it launches. In the Open dialog that appears, navigate to Applications/CoronaSDK/SampleCode/Physics/HelloPhysics (Mac) or C:\Program Files (x86)\Corona Labs\Corona SDK\Sample Code\Physics\HelloPhysics (Windows). On a Mac, click on Open, and it will automatically open main.lua. On Windows, double-click on main.lua to open the file. The HelloPhysics application opens and runs in the simulator.

What just happened?

Accessing the SDK through the Corona terminal or Corona simulator is a matter of preference. Many Mac users prefer to use the Corona terminal so that they can track messages outputted to the terminal. When you launch the SDK through the Corona simulator, the simulator will be displayed, but not the terminal window. When Windows users launch the Corona simulator, it will display both the simulator and the terminal window. This is nice to use when you want play around with any of the example applications that are provided by Corona.

The main.lua file is a special filename that tells Corona where to start in a project folder. This file can also load other code files or other program resources such as sounds or graphics.

When you launch the HelloPhysics application in Corona, you will observe a box object fall from the top of the screen in the simulator and collide with a ground object. The transition from launching the main.lua file to viewing the results in the simulator is almost immediate.

Have a go hero – use a different device shell

As you start getting familiar with the Corona simulator, whether you're in Windows or Mac OS X, a default device is always used when you launch an application. Windows uses the Droid as the default device, while the Mac OS X uses the regular iPhone. Try launching the sample code in a different device shell to view the differences in screen resolution between all the devices the simulator has available.

When porting builds to more than one platform, you'll have to consider the variety of screen resolutions in both iOS and Android devices. A build is a compiled version of all your source code that is converted into one file. Having your game build configured for multiple platforms broadens the audience reach of your application.

主站蜘蛛池模板: 澄迈县| 建德市| 康平县| 昌黎县| 余姚市| 乡城县| 林口县| 衡阳县| 普洱| 驻马店市| 永昌县| 神池县| 峡江县| 尼玛县| 邢台县| 平邑县| 潜江市| 仪陇县| 恭城| 漳平市| 乳源| 正宁县| 玛曲县| 台北县| 阿拉尔市| 犍为县| 浦城县| 中西区| 吐鲁番市| 和政县| 乐至县| 莆田市| 扎鲁特旗| 克东县| 故城县| 永吉县| 中西区| 英山县| 建昌县| 和田县| 阳西县|