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

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
主站蜘蛛池模板: 若羌县| 桑植县| 定西市| 崇左市| 德保县| 永嘉县| 句容市| 张家口市| 华阴市| 三台县| 盘锦市| 于田县| 将乐县| 昌图县| 远安县| 湘西| 中方县| 尉犁县| 宜丰县| 德钦县| 华蓥市| 屏东市| 平果县| 吉木萨尔县| 綦江县| 大名县| 长海县| 绩溪县| 神木县| 北宁市| 闵行区| 金山区| 东丽区| 新乐市| 托克托县| 神木县| 宜都市| 霍邱县| 山西省| 台北县| 江城|