Questions tagged [sktilemapnode]

A SpriteKit node used to render a 2D map of textured sprite tiles. Supported tile types include rectangular, hexagonal and isometric.

73 questions
0
votes
1 answer

How to I call SKTileSet init(named:) in objective C?

I was able to create an SKTileSet on xcode but it seems like I am having a difficult time being able to init an SKTileSet with passing through a name like here: https://developer.apple.com/documentation/spritekit/sktileset/1643819-init This would be…
Andy Nguyen
  • 451
  • 5
  • 17
0
votes
1 answer

How to position SKTilemap Scene in the middle of screen in Swift

I have created a TilemapScene (CKTilemapScene.sks) in Swift 5. This is basically to lay a tile map background of my game project. Refer to the second screenshot below. Then, in my main swift code, I load all the background with the standard…
0
votes
1 answer

How to set the opacity of a tileset in spritekit tilemap?

I have a code to define the PhysicsBody for everysingle tiles in tilemap like below: func setUpSceneWithMap(map: SKTileMapNode) { let tileMap = map tileMap.setScale(0.4) let startingLocation: CGPoint = tileMap.position …
Khoi Le
  • 3
  • 4
0
votes
1 answer

SOLVED: Anchor control button when moving the character in tile map?

I am working on a game where the character will be controled by a set of 4 buttons like in the old consoles. I used Tile Map in spritekit to create the map. Everything works fine (the players is moving when pressing the buttons, the scene follow…
Khoi Le
  • 3
  • 4
0
votes
1 answer

Positioning SKTileMapNode in Swift Spritekit

I tried to position the Tile Map so that the bottom left of it is attached to the bottom left of the screen. Below is the code i tried to use: func setUpSceneWithMap(map: SKTileMapNode) { let tileMap = map tileMap.setScale(1) …
Khoi Le
  • 3
  • 4
0
votes
1 answer

Custom Hexagonal SKTileSet's Tile don't fit the SKTileMap's Hexes

So I've been trying trying to make an SKTileMap using the xcode editor. I have downloaded the assets from here. Put everything in my assets, and created an empty tileset that I filled with the tiles. Now when I go make the tile map on my sks file,…
0
votes
0 answers

Move enemy to player's new position

In the code below I move the player to a tile that the player touches, and then what I expect to happen is also move the enemy to the player's new position. What actually happens is the enemy moves to the tile that the player was on before moving.…
Ilya
  • 33
  • 3
0
votes
1 answer

Getting tileGroup from skSpriteNode position

Hello I am working on a small game that takes place on a checkerboard style SKtilemap. When spawning enemies, I would like them only to appear on the light tiles (as well as only in the top half of the map and not on the player character). To do…
Ilya
  • 33
  • 3
0
votes
1 answer

Change color of specific tiles in SKTileMapNode

I am creating a round based game where I have a playground as a SKTileMapNode with grass textures on every tile where characters can walk from tile to tile. Every character has his own reach where they can walk in one round. I want to display this…
T. Yueksel
  • 69
  • 1
  • 10
0
votes
2 answers

SpriteKit Tileset Memory Leak

I am trying to create 2d platform game using SpriteKit. The game contains 21 levels, this means 21 scenes and 21 tilesets as well. Each scene contains several tilenodes, all of which uses only 1 tileset. At some point I found that my game consume…
acidbeast
  • 43
  • 8
0
votes
1 answer

Trouble setting color of SKTileMapNode

I have a custom class that contains an SKTileMapNode (named "gmap") as a member variable. I want to use the .color property to recolor the Node depending on user interaction. Im using the following code to change the color. (using different…
Alec Barton
  • 197
  • 2
  • 11
0
votes
1 answer

Set physic body in SKTileMapNode on Spritekit

I’m using Spritekit and a SKTileMapNode. I have some tilesand I want to add them a physic body for create a collision. How can I do that?
0
votes
0 answers

Add Physics only to the sprites that are within my view

I have a tileMap and within it some tileNodes, I am looking to only give physics to the tilesNodes that are within the screen view and as the player navigates the world, the tileNodes that come into screen view get physics and the tileNodes that go…
0
votes
0 answers

SKTileMapNode not loading to the right size

For a project that I am currently working on, I have two SKTileMapNodes stacked on top of each other. They differ in the number of rows, columns as well as tile size. However, it should equate so that they are the same overall width and height. The…
0
votes
1 answer

Pinch Gesture Not Working with SKCameraNode

I'm working with Swift 4 using SpriteKit with an SKTileMapNode and an SKCameraNode. I want to be able to pan/pinch/zoom on the tile map node using the camera. I've got panning working well but I'm running into some issues with pinch/zooming. While…
XBXSlagHeap
  • 174
  • 1
  • 16