Exemplo n.º 1
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetButton("Jump"))
     {
         Vector3Int tileStart = ct.GetTilePos(player.position);
         maze = MakeMaze.RecursiveDivision(20, 20, 5, 5);
         Link(tileStart.x, tileStart.y);
     }
 }
Exemplo n.º 2
0
    private void BoardSetup()
    {
        //create parent object
        this.boardHolder = new GameObject("Board").transform;

        MakeMaze makeMaze = new MakeMaze(width, height);

        makeMaze.DigMaze();

        this.Maze = makeMaze.Maze;

        for (int x = 0; x < width; x++)
        {
            for (int y = 0; y < height; y++)
            {
                switch (this.Maze[x, y, 0])
                {
                case 0:
                    SetTiles(wallTiles[8], x, y);
                    break;

                case 1:
                    SetTiles(floorTiles[0], x, y);
                    break;

                case 2:
                    SetTiles(floorTiles[0], x, y);
                    break;

                case 3:
                    SetTiles(stairsTile, x, y);
                    break;

                default:
                    break;
                }
            }
        }
    }