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

Chapter 2. Adding Bodies to the World

Bodies are what make Box2D games possible. Anything you can move or interact with, is a body . Birds, pigs, and crates in Angry Birds are bodies, as well as the idol and the totem bricks in Totem Destroyer.

During this chapter, you will learn to create every kind of Box2D body, in addition to some other important features, including:

  • Creating circular bodies
  • Creating rectangular bodies
  • Creating any kind of polygon
  • Using debug draw to test your simulation
  • Defining body types: static, dynamic, or kinematic
  • Setting material attributes: density, friction, and restitution
  • Units of measurement
  • Creating compound objects

By the end of the chapter, you will have your first Totem Destroyer level ready to play with. This will be a long chapter, so let's drive straight to the point.

主站蜘蛛池模板: 垣曲县| 灵寿县| 无棣县| 贞丰县| 通渭县| 广河县| 望奎县| 静宁县| 法库县| 桑日县| 丰宁| 资源县| 萍乡市| 潞西市| 永善县| 碌曲县| 合山市| 岳西县| 伊金霍洛旗| 吴旗县| 鸡泽县| 综艺| 封丘县| 大港区| 宜黄县| 云和县| 石林| 扶沟县| 安塞县| 平原县| 湘潭县| 巫山县| 西乌珠穆沁旗| 敖汉旗| 抚远县| 崇阳县| 巴林右旗| 合阳县| 阿荣旗| 麻栗坡县| 三穗县|