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
8
votes
2 answers

Programmatically create SKTileMapNode in Swift

does anyone know how to create an SKTileMapNode programmatically using Swift please? (NOTE: I do not want to do this using the editor, I want to achieve this programmatically only) I have tried the following but does not render my tile map let…
Neil Stevens
  • 3,534
  • 6
  • 42
  • 71
7
votes
1 answer

What is the proper way to programmatically create a SpriteKit SKTileMap?

I am creating a tile map for an iOS game I am working on. The map is a top down view of an island. Most of the tiles are water, but some are land. The water tile is reused to create the water, but none of the land tiles are used more than once,…
7
votes
4 answers

Giving physics to tiles of SKTileMapNode in Xcode 8

I am learning Swift, and as a project I am working on a tile based 2D game similar to super mario where my character will walk and jump on tiles. The latest version of Xcode and Sprite Kit give the ability to create a Tile Map directly in Xcode. In…
MJ1986
  • 91
  • 1
  • 2
4
votes
1 answer

SKTileMapNode: Create an infinitely sized tile map

Over on the Apple Documents It claimes you can make an infinitely sized SKTileMap Generating procedural game-world maps resembling natural terrain. You can create game world of infinite size by using procedural noise as its underlying…
E. Huckabee
  • 1,788
  • 1
  • 13
  • 29
4
votes
1 answer

SKTileMap getting Values from GKNoiseMap

ive been following the Apple Docs on GKNoiseMaps and i managed to get an image to spawn and it looks really good using this code here class GameScene: SKScene { class Noise: GKNoise { var NoiseSource = GKPerlinNoiseSource(frequency: 0.05,…
E. Huckabee
  • 1,788
  • 1
  • 13
  • 29
4
votes
0 answers

How to reorder single tile groups within a tile set of SpriteKit?

In Xcode's SpriteKit, a "Tile Set" is a collection of "Tile Groups". In the editor, these Tile Groups appear in a certain order (top to bottom) based on the order in which you created them. Two questions: Is there a way to RE-ORDER the Tile Groups…
3
votes
1 answer

Equivalent of a popover in SpriteKit

I'm using Swift 5, SpriteKit, SKTileMap. I would like to use the equivalent of a popover. I'm using this term, because I use popovers rather frequently in other apps. Basically, a small window appears, and you read something and press OK, or maybe…
3
votes
2 answers

SpriteKit sktilemapnode vertical line glitch

I am making a 2d platformer and I decided to use multiple tilemapnodes as my backgrounds. Even with 1 tile map, I get these vertical or horizontal lines that appear and disappear when I'm moving the player around the screen. See image below: My…
Discoveringmypath
  • 1,049
  • 9
  • 23
3
votes
1 answer

SKTileMapNode: detecting touched Tile?

Imagine a game world that's nothing other than an SKTileMapNode with 10x10 tiles on the screen. The user touches a tile. Does SKTileMapNode provide a way to know which tile has been touched? Or do coordinate hunts need be done to determine which…
Confused
  • 6,048
  • 6
  • 34
  • 75
3
votes
1 answer

Adding Collision Detection to SKTileMapNode

What's the recommended way of adding collision detection to an SKTileMapNode for a side scroller? Say I have a simple tilemap with just one single tile to use as the ground, how can I detect when my player sprite lands on one of the filled ground…
Sawyer05
  • 1,604
  • 2
  • 22
  • 37
3
votes
1 answer

Can't Edit Tile Map Xcode 8 GM

I can't for the life of me figure out how to edit my tile map in Xcode 8 GM. Double-clicking does nothing, and in the Editor dropdown "Edit Tile Map" is greyed-out. All I've done is drag-and-drop the tile map onto the scene, and even creating a new…
Mike
  • 9,765
  • 5
  • 34
  • 59
2
votes
1 answer

Spritekit: How to limit player movement to certain tiles only

Background of the problem: As shown in the screenshot, I have a 24*24 tilemap and a player sprite node. The current problem I am trying to solve is, I hope to restrict the movement of the player just within the letter A shaped red tiles. The…
2
votes
1 answer

SKTileMap physics bug on real devices

I have been developing a 2D SpriteKit game that makes use of tile maps. I gave to my tile maps an SKPhysicsBody with this func: import SpriteKit func giveTileMapPhysicsBody(map: SKTileMapNode) { let tileMap = map let tileSize =…
I Don't Tell
  • 264
  • 1
  • 15
2
votes
0 answers

Fill everything outside a quadrilateral given the four corner positions of that quadrilateral

I have an SKTileMapNode that I am filling with rooms using a BSP algorithm I translated into Swift from this tutorial. The fully translated algorithm can be found on my github repo I have a custom class that gives me four corner positions of a room.…
E. Huckabee
  • 1,788
  • 1
  • 13
  • 29
2
votes
0 answers

Dungeon generation algorithm is generating undesired results

I wrote an algorithm to generate dungeons in Swift for iOS using SpriteKit. The code functions as expected generating regular polygons with four sides. But when I switch to an 8-way adjacency group, the generator starts messing up. Here is the code…
E. Huckabee
  • 1,788
  • 1
  • 13
  • 29
1
2 3 4 5