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

Chapter 3. Mix in the Physics

SpriteKit includes a fully functional physics engine. It is easy to implement and very useful; 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 world, bounce and spin colliding sprites against each other, and create realistic movement through impulses – and it does all of this before every single frame is drawn to the screen.

The topics in this chapter include:

  • 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
主站蜘蛛池模板: 浏阳市| 辉县市| 长宁区| 新巴尔虎左旗| 娄底市| 朝阳县| 正安县| 孟州市| 冀州市| 郧西县| 霍州市| 珠海市| 辛集市| 攀枝花市| 龙口市| 姚安县| 阿鲁科尔沁旗| 洛川县| 始兴县| 云阳县| 滨海县| 汤阴县| 沂水县| 柳江县| 双流县| 巴东县| 色达县| 梁平县| 惠州市| 沈丘县| 潢川县| 兴业县| 开封县| 樟树市| 河津市| 山丹县| 绵阳市| 青州市| 咸丰县| 扶余县| 察雅县|