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

Downloading and installing Box2D for Flash

You can download the latest version of Box2D for Flash either from the official site (http://www.box2dflash.org/download) or from the SourceForge project page (http://sourceforge.net/projects/box2dflash/).

Once you have downloaded the zipped package, extract the Box2D folder (you can find it inside the Source folder) into the same folder you are using for your project. The following is how your awesome game folder should look before you start coding:

Downloading and installing Box2D for Flash

You can see the Box2D folder, the FLA file that I am assuming has a document class called Main and therefore Main.as, which is the class we will work on.

I would suggest you work on a 640 x 480 Flash movie at 30 frames per second (fps). The document class should be called Main and the examples will look better if you use a dark stage background color, such as #333333. At least these are the settings I am using throughout the book. Obviously you can change them as you want, but in that case your final movies may look a bit different than the examples shown in the book.

Now let's import Box2D classes.

主站蜘蛛池模板: 老河口市| 米易县| 西峡县| 扬中市| 札达县| 前郭尔| 泰和县| 石河子市| 承德县| 双鸭山市| 建德市| 江北区| 龙南县| 五莲县| 新兴县| 湘潭市| 仁寿县| 连平县| 凤翔县| 曲麻莱县| 伽师县| 临泽县| 酒泉市| 高要市| 金山区| 葵青区| 长沙市| 文山县| 鹤岗市| 临泉县| 平泉县| 全州县| 临颍县| 三江| 曲靖市| 通化县| 甘谷县| 石城县| 南郑县| 荣成市| 武定县|