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

  • Game Development with Swift
  • Stephen Haney
  • 181字
  • 2021-07-16 13:45:39

Chapter 2. Sprites, Camera, Actions!

Drawing with SpriteKit is a breeze. We are free to focus on building great gameplay experiences while SpriteKit performs the mechanical work of the game loop. To draw an item to the screen, we create a new instance of a SpriteKit node. These nodes are simple; we attach a child node to our scene, or to existing nodes, for each item we want to draw. Sprites, particle emitters, and text labels are all considered nodes in SpriteKit.

Note

The game loop is a common game design pattern used to constantly update the game many times per second, and to maintain the same gameplay speed on fast or slow hardware.

SpriteKit wires new nodes into the game loop automatically. As you gain expertise with SpriteKit, you may wish to explore the game loop further to understand what is going on "under the hood".

The topics in this chapter include:

  • Preparing your project
  • Drawing your first sprite
  • Animation: movement, scaling, and rotation
  • Working with textures
  • Organizing art into texture atlases
  • Centering the camera on a sprite
主站蜘蛛池模板: 繁昌县| 澄江县| 池州市| 浦江县| 丘北县| 靖宇县| 惠州市| 会理县| 赤水市| 伊金霍洛旗| 澎湖县| 华安县| 枣庄市| 麻城市| 灵宝市| 龙南县| 罗山县| 巩义市| 会同县| 万宁市| 新宁县| 鱼台县| 庐江县| 凤翔县| 西乡县| 滨州市| 磐石市| 定州市| 贡嘎县| 鄱阳县| 东乡| 临高县| 伊金霍洛旗| 沁源县| 泸西县| 台安县| 柳江县| 泰州市| 抚州市| 边坝县| 安泽县|