コード例 #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());
    }
コード例 #3
0
    private void deleteRows()
    {
        resetControlBlockParameter();

        deleteRow();

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

        m_waitUpDownArrowKey = true;

        //	新たに生成したブロックが出現時点で設置済みのブロックと衝突している場合.
        if (checkCollision(m_controlBlockLeft, m_controlBlockTop, m_blockManager.GetControlBlock()))
        {
            //	ゲームオーバーに遷移する.
            m_gameState = GameState.GAME_OVER;

            clearFieldState();
            setEnableGameObject();

            m_blockRenderer.ResetRenderNextBlock();
        }
    }