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

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
主站蜘蛛池模板: 华阴市| 鄄城县| 攀枝花市| 灵武市| 马尔康县| 永定县| 建平县| 满城县| 鲜城| 蒲江县| 浮梁县| 会泽县| 望江县| 特克斯县| 彭泽县| 遵义市| 昌江| 濮阳市| 奎屯市| 宁波市| 丹巴县| 西贡区| 彩票| 扬州市| 峡江县| 府谷县| 抚顺市| 于都县| 罗田县| 河源市| 海伦市| 建宁县| 许昌县| 介休市| 晋州市| 翼城县| 木兰县| 镶黄旗| 桃园市| 壤塘县| 深圳市|