Exemplo n.º 1
0
    public IEnumerator GeneratePlatformerMap(GameProgram.MapSize mapSize)
    {
        //Randomly choose the number of rooms (from a range, based on size)
        int iterations = 10;

        if (mapSize == GameProgram.MapSize.Small)
        {
            iterations = UnityEngine.Random.Range(30, 40);
        }
        else if (mapSize == GameProgram.MapSize.Medium)
        {
            iterations = UnityEngine.Random.Range(41, 60);;
        }
        else if (mapSize == GameProgram.MapSize.Large)
        {
            iterations = UnityEngine.Random.Range(61, 80);
        }

        string path = PlatformerPathString(iterations);

        Debug.Log("path: " + path);

        _pProgram = PlatformerCompiler.Compile(path);
        yield return(_pProgram.Run());
    }