Lukas Köhl
Lukas Köhl

Reputation: 1589

SpriteKit: Creating a tile based maze

I want to create a game with a maze(not really) in it. The whole map should be surrounded by wall and inside these walls there should be a maze. This maze should be randomly created. On every tile where no wall is placed, the player should be randomly placed. Is there a build in class/function in SpriteKit that can fulfill my requirements or do I need to come up with an algorithm by myself?

PS: A possible visualization would be the game PacMan with randomly created stages.

Upvotes: 1

Views: 834

Answers (1)

MikeJ
MikeJ

Reputation: 2437

You can use a tile map to create your maze/levels, but you will need to write the code to do this. It will be a tough algorithm to ensure that each level is playable/winnable. Might be worth starting with defined layouts to get the game play right, then add in random generation.

Upvotes: 1

Related Questions