Ejemplo n.º 1
0
    public void StartGame(GameRoundLevel level)
    {
        SetGameLevel(level);

        GenerateNewMap();

        if (OnStartGame != null)
        {
            OnStartGame();
        }
    }
Ejemplo n.º 2
0
    void SetGameLevel(GameRoundLevel level)
    {
        int x = 0;
        int y = 0;

        switch (level)
        {
        case GameRoundLevel.EASY:
        {
            x = 4;
            y = 3;
        }
        break;

        case GameRoundLevel.NORMAL:
        {
            x = 6;
            y = 4;
        }
        break;

        case GameRoundLevel.HARD:
        {
            x = 7;
            y = 5;
        }
        break;
        }
        mMinPos = new Vector3Int(-x, -y, 0);
        mMaxPos = new Vector3Int(x, y, 0);

        mBoomCount = x * y * 3 / 4;
        mMapBounds = new BoundsInt(-x, -y, 0, x * 2 + 1, y * 2 + 1, 0);

        mTotalCellCount  = mMapBounds.size.x * mMapBounds.size.y;
        mOpenedCellCount = 0;

        RefreshMapData();

        Debug.Log(mMapBounds);
    }