Ejemplo n.º 1
0
    private void Start()
    {
        // Re-Init the pad...
        m_PlayerActionsBindings = new PlayerActions();
        m_PlayerActionsBindings.UI_Back.ClearInputState();
        m_PlayerActionsBindings.UI_Confirm.ClearInputState();
        m_PlayerActionsBindings.UI_Pause.ClearInputState();


        m_gcHighScoreUI = GameInstance.Object.GetHighScoreCecconoid();
        GAssert.Assert(null != m_gcHighScoreUI, "Unable to get reference to the high score ui!");



        // Are we entering our initials?
        if (GameGlobals.s_bCEcconoidHighScoreEntryThisGo)
        {
            m_gcEntryInitial = m_gcHighScoreUI.GetTextEntry(m_iEntry);
            GAssert.Assert(null != m_gcEntryInitial, "gs_Eugatron_HighScore_In: Unable to get first text entry for initials");
            m_iState = Types.EHighScoreMenuState._ENTER_NEW_INITIAL1;
        }
        else
        {
            m_gcHighScoreUI.OnShowTable();
            m_iState     = Types.EHighScoreMenuState._SHOW_TABLE;
            m_fEventTime = TimerManager.fGameTime + Types.s_fDUR_GameOverScreen;
        }
    }
Ejemplo n.º 2
0
    private void EnterInitialsUpdate()
    {
        // Check for the confirm button, to move onto the next initial or save and show table
        // This needs to run every tick....
        if (m_PlayerActionsBindings.UI_Confirm.WasPressed)
        {
            m_sFinalInitials.Insert((int)m_iEntry, Types.s_sHS_English.Substring(m_iAlphabetIndex, 1));

            ++m_iEntry;
            if (m_iEntry < 3)
            {
                m_gcEntryInitial = m_gcHighScoreUI.GetTextEntry(m_iEntry);
                m_iAlphabetIndex = 0;
            }
            else
            {
                GameGlobals.SaveCecconoidScore(m_gcHighScoreUI.GetFinalString());
                m_gcHighScoreUI.OnShowTable();
                m_iState     = Types.EHighScoreMenuState._SHOW_TABLE;
                m_fEventTime = TimerManager.fGameTime + Types.s_fDUR_GameOverScreen;
            }
        }


        // Now reduce update frequency, don't care about scrolling quickly
        {
            ++m_iFrameCounter;
            if (m_iFrameCounter < 4)
            {
                return;
            }
            m_iFrameCounter = 0;
        }


        // Get the player's input
        Vector2 vMovementTrajectory = m_PlayerActionsBindings.GE_Move;

        // Deadzone it, same as in-game.
        if (vMovementTrajectory.magnitude < Types.s_fDeadZone_Movement)
        {
            vMovementTrajectory = Vector2.zero;
        }
        else
        {
            vMovementTrajectory = vMovementTrajectory.normalized * ((vMovementTrajectory.magnitude - Types.s_fDeadZone_Movement) / (1.0f - Types.s_fDeadZone_Movement));
        }

        // Move through the list of available letters
        if (vMovementTrajectory.x > Types.s_fDeadZone_Movement)
        {
            ++m_iAlphabetIndex;
        }
        else if (vMovementTrajectory.x < -Types.s_fDeadZone_Movement)
        {
            --m_iAlphabetIndex;
        }

        // Clamp (Roll round?)
        if (m_iAlphabetIndex < 0)
        {
            m_iAlphabetIndex = 0;
        }
        if (m_iAlphabetIndex > 26)
        {
            m_iAlphabetIndex = 26;
        }

        // Set the initial visibile on-screen
        m_gcEntryInitial.text = Types.s_sHS_English.Substring(m_iAlphabetIndex, 1);
    }