Steps done in generation:

Previsouly direction was chosen randomly. If not yet in list of directions: Add to list of directions. 

This has been changed to get the same level each time you start. But they are still generated. So no random function, only iteration over some seed-data

  1. Check if there is an empty spot in the direction
  2. Check if there are no position taken within a radius of 3 tiles
  3. When new spot .. Direction list will be emptied.
  4. This will make one path. 
  5.  if random == x :  extra paths generated on those spots where direction changed
  6. All paths get inverted. A shape is formed where the edges of the shape are calculated
  7. Using the Marching Squares :
  8. During the marching squares routine we count the number of positions on the edge. If there are more than 60 it is a candidate for 3D generation.
  9. The data is send to the 3D generator that makes Linear Extrusion of this data to form a Mesh that occupies all the edges.
  10. Count all neighbours of a tile. When there are 3 : we are on a dead end
  11. Select (maximum of 3) random selected dead-ends and put treasure on it (BeachBall)
  12. Starting player position is always 1 row, 1 col