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

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
主站蜘蛛池模板: 淮北市| 千阳县| 汕尾市| 弥渡县| 湟中县| 龙岩市| 灵寿县| 通海县| 高密市| 车致| 扶风县| 东辽县| 平昌县| 黑河市| 开江县| 鄱阳县| 北碚区| 静海县| 栾川县| 天全县| 务川| 汶上县| 德庆县| 德格县| 静宁县| 浮山县| 驻马店市| 临汾市| 周口市| 嘉黎县| 台中县| 贵南县| 藁城市| 阳泉市| 耿马| 花莲县| 措勤县| 威远县| 微山县| 望都县| 北流市|