示例#1
0
    public void ResetToStartGame()
    {
        m_deletedRows = 0;

        m_blockMoveModeChangeTime_s = 0.0f;
        m_blockMoveDeltaTime_s      = 0.0f;

        m_blockFallDeltaTime = 0.0f;

        m_gameState = GameState.PLAY_GAME;

        m_waitUpDownArrowKey = false;

        resetFieldState();

        setEnableGameObject();

        resetControlBlockParameter();
        m_blockManager.ResetForGameStart();
        m_waitUpDownArrowKey = false;

        m_scoreLevelRendererObject.GetComponent <Score_LevelRenderer> ().Reset();

        BLOCK_FALL_TIME_MAX_SEC = BLOCK_FALL_TIME_MAX_SEC_DEFAULT;

        m_rendererObject.GetComponent <BlockRenderer>().SetRenderNextBlock(
            m_blockManager.GetNextBlock(), m_blockManager.GetNextBlockType());

        m_enableVanishEffect = false;

        m_scoreLevelRendererObject.GetComponent <Score_LevelRenderer>().SetLevelUpRowCountMax(
            LEVEL_UP_ROW_COUNT);
    }
示例#2
0
    public cTetrisManager(GameObject rendererObject)
    {
        m_blockManager = new ControlBlockManager();

        m_field = new FieldBlockType[cTetrisParam.MAP_HEIGHT, cTetrisParam.MAP_WIDTH];

        m_blockRenderer = rendererObject.GetComponent <BlockRenderer> ();
        m_blockRenderer.Initialize(cTetrisParam.MAP_WIDTH, cTetrisParam.MAP_HEIGHT);

        m_blockMoveModeChangeTime_s = 0.0f;
        m_blockMoveDeltaTime_s      = 0.0f;

        BLOCK_FALL_TIME_MAX_SEC = cTetrisParam.BLOCK_FALL_TIME_MAX_SEC_DEFAULT;

        m_blockFallDeltaTime = 0.0f;

        m_waitUpDownArrowKey = false;

        resetFieldState();

        setEnableGameObject();

        resetControlBlockParameter();

        m_blockManager.ResetForGameStart();

        m_blockRenderer.SetRenderNextBlock(
            m_blockManager.GetNextBlock(), m_blockManager.GetNextBlockType());
    }