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

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
主站蜘蛛池模板: 绥化市| 墨脱县| 隆化县| 阜康市| 抚州市| 吉木萨尔县| 高雄市| 民和| 密山市| 长沙市| 长沙县| 嘉鱼县| 光山县| 沈丘县| 阳山县| 卢氏县| 邵阳县| 六安市| 鄢陵县| 桐乡市| 临汾市| 青河县| 揭阳市| 上高县| 神池县| 仁寿县| 平原县| 唐海县| 扎兰屯市| 兴安盟| 哈密市| 安阳市| 大同县| 普定县| 固镇县| 商南县| 宁德市| 眉山市| 香河县| 阜阳市| 博湖县|