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

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.

主站蜘蛛池模板: 聂拉木县| 镇康县| 盐边县| 织金县| 辉县市| 于田县| 定兴县| 黑水县| 临泽县| 长岛县| 剑阁县| 乡城县| 琼中| 罗江县| 西安市| 盈江县| 巴林左旗| 闻喜县| 若羌县| 通城县| 蕲春县| 抚宁县| 云林县| 韶山市| 普陀区| 青龙| 德化县| 巴中市| 金寨县| 拉萨市| 清河县| 萍乡市| 洛南县| 蓬莱市| 郧西县| 昆明市| 巴彦淖尔市| 辛集市| 潞西市| 山阳县| 定兴县|