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

Chapter 3. Mix in the Physics

SpriteKit includes a fully functional physics engine. It is easy to implement and very useful, as most mobile game designs require some level of physical interaction between game objects. In our game, we want to know when the player runs into the ground, an enemy, or a power-up. The physics system can track these collisions and execute our specific game code when any of these events occur. SpriteKit's physics engine can also apply gravity to the game world—as well as the bounce and spin that can occur when sprites collide with each other—and creates realistic movement through impulses; and it does all of this before every single frame is drawn on the screen!

The topics in this chapter include the following:

  • Adopting a protocol for consistency
  • Organizing game objects into classes
  • Adding the player's character
  • Renovating the GameScene class
  • Physics bodies and gravity
  • Exploring physics simulation mechanics
  • Movement with impulses and forces
  • Bumping bees into bees
主站蜘蛛池模板: 牡丹江市| 金乡县| 晴隆县| 兴海县| 独山县| 肇源县| 民乐县| 海口市| 林甸县| 巴东县| 泸定县| 竹北市| 平和县| 鹤庆县| 荆门市| 高尔夫| 化德县| 绥芬河市| 营山县| 肃宁县| 聊城市| 西充县| 元江| 越西县| 叶城县| 禹州市| 泸西县| 昌吉市| 洛川县| 花莲县| 北京市| 略阳县| 花莲市| 安塞县| 祁东县| 竹山县| 蓬莱市| 邢台县| 翁牛特旗| 江孜县| 农安县|