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

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
主站蜘蛛池模板: 临高县| 彰化市| 自治县| 道孚县| 开平市| 兴义市| 晴隆县| 定陶县| 罗江县| 乐亭县| 永登县| 沂水县| 冀州市| 德格县| 启东市| 梁河县| 聂拉木县| 新巴尔虎右旗| 惠水县| 陆丰市| 新河县| 谷城县| 赤峰市| 白河县| 巴林右旗| 犍为县| 富宁县| 五指山市| 睢宁县| 尼木县| 呼伦贝尔市| 桃园县| 万年县| 广州市| 英吉沙县| 襄垣县| 石门县| 屏东市| 昌都县| 迁西县| 师宗县|