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

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.

主站蜘蛛池模板: 新沂市| 韩城市| 石景山区| 莱州市| 略阳县| 徐水县| 阳江市| 闽侯县| 宣威市| 通化市| 建阳市| 长沙县| 惠来县| 梓潼县| 台东市| 扎赉特旗| 大冶市| 台中市| 西盟| 若羌县| 容城县| 祁连县| 新乐市| 当雄县| 广宁县| 兴安盟| 三原县| 乐山市| 什邡市| 邹平县| 浑源县| 辽宁省| 和硕县| 上饶市| 正镶白旗| 泾阳县| 沈丘县| 河间市| 德格县| 辽宁省| 彭水|