1

I recently read this raywenderlich article about using tile map node:

https://www.raywenderlich.com/1079-what-s-new-in-spritekit-on-ios-10-a-look-at-tile-maps

In my own project, I have coded the tiles myself using SKShapeNode. Works great, but there is one thing I noticed after reading the article:

enter image description here

In the tutorial it says that there are only 5 nodes, when there are clearly quite a lot more tiles; probably more than 100. In my own project however, using an 8*8 tile board, it says that I have more than 130 nodes.

So my questions are:

  • Why does it say that there are only 5 nodes? Is there some magic with Tile Map Node that reduce the number of active nodes?

  • If Tile Map Node really does decrease the nodes, does this mean that it increase performance in comparison to manually programing the tiles oneself, making Tile Map Node that much better in terms of performance?

mnuages
  • 13,049
  • 2
  • 23
  • 40
Mark Tornej
  • 165
  • 9
  • 1
    SKShapeNode is the absolute worse node to choose. You should do whatever you can to avoid using them. – Knight0fDragon Sep 06 '19 at 12:56
  • @KnightOfDragon Ah, I see, thank you. Because of performance? Other than `Tile Map Node` what other ways are there to implement nodes? `SKSpriteNode`? Doesn't seem to be able to do the same thing as `SKShapeNode` – Mark Tornej Sep 06 '19 at 12:59
  • TileMaps do not add to your node count, because they are not nodes. Tile maps are designed to be efficient. As for other nodes, it depends on what you need to do. Nothing is stopping you from using an SKShapeNode to create a texture that you could then use on an SKSpriteNode – Knight0fDragon Sep 06 '19 at 12:59
  • @KnightOfDragon Ok, that makes sense, `Tile Map Node` it is then. And perhaps combining `SKShapeNode` and `SKSpriteNode`. Gonna try it out, thanks! :) – Mark Tornej Sep 06 '19 at 13:18

0 Answers0