示例#1
0
文件: StartView.cs 项目: gbdb71/ld40
    // Use this for initialization
    void Start()
    {
        startButton.ChangeVisibility(true);

        if (Application.platform != RuntimePlatform.WebGLPlayer)
        {
            quitButton.ChangeVisibility(true);
        }

        SceneManager.LoadSceneAsync("Options", LoadSceneMode.Additive);
    }
示例#2
0
    void Collapse()
    {
        ProgressManager.Instance.level = 0;
        collapsed = true;

        playerAnimator.speed = 1f;
        playerAnimator.SetTrigger("end");

        face.Emote(Face.Emotion.Sad);

        text1.Show();
        text2.Show();
        menuButton.GetComponent <BoxCollider2D> ().size = menuButton.GetComponent <BoxCollider2D> ().size;
        menuButton.ChangeVisibility(true);
    }
示例#3
0
文件: Manager.cs 项目: gbdb71/ld40
    void DelayedDisplayText()
    {
        buttonToShow.ChangeVisibility(true);
        infoDimmerAnim.Show();
        infoTextAnim.Show();

        cam.Shake(0.15f, 0.15f);
        cam.Chromate(0.75f, 0.1f);

        if (currentTurn == 1)
        {
            AudioManager.Instance.PlayEffectAt(15, Vector3.zero, 0.5f);
        }
        else
        {
            AudioManager.Instance.PlayEffectAt(8, Vector3.zero, 0.5f);
        }

        quitButton.ChangeVisibility(true);
    }
示例#4
0
文件: Manager.cs 项目: gbdb71/ld40
    public void Calculate()
    {
        if (matrixArea.CardCount() > 0 && operatorArea.CardCount() > 0)
        {
            cam.BaseEffect();

            CancelInvoke("HintOrTaunt");

            locked = true;

            Card c  = matrixArea.PopCard();
            Card oc = operatorArea.PopCard();
            int  op = oc.GetOperation();

            if (op == 0)
            {
                resultMatrix.Add(c.GetMatrix());
            }

            if (op == 1)
            {
                resultMatrix.Subtract(c.GetMatrix());
            }

            if (op == 2)
            {
                resultMatrix.Multiply(c.GetMatrix());
            }

            EffectManager.Instance.AddEffect(0, c.transform.position);
            EffectManager.Instance.AddEffect(0, oc.transform.position);

            Destroy(c.gameObject);
            Destroy(oc.gameObject);

            handArea.SpawnCards(1, 1);

            calcButton.ChangeVisibility(false);

            int winner = resultMatrix.CheckLines(playerNum, opponentNum);

            roundEnded = false;

            if (winner != -1 && currentTurn == 0)
            {
                playerBlock.face.Emote(Face.Emotion.Happy);
                opponentBlock.face.Emote(Face.Emotion.Sad);
                roundEnded = true;

                DisplayText("You win!", nextButton, 1f);
            }

            if (winner != -1 && currentTurn == 1)
            {
                opponentBlock.face.Emote(Face.Emotion.Happy);
                playerBlock.face.Emote(Face.Emotion.Sad);
                roundEnded = true;

                DisplayText("You lose!", retryButton, 1f);
            }

            turnNumber++;
            currentTurn = (currentTurn + 1) % 2;

//			currentTurn = 0; // always player turn

            if (!roundEnded)
            {
                UpdateTurnIndicators();

                AudioManager.Instance.Highpass(currentTurn == 1);
            }
            else
            {
                turnIndicators [0].Hide();
                turnIndicators [1].Hide();
            }

            if (turnNumber >= 4 && currentTurn == 0)
            {
                ProgressManager.Instance.SpaceTutorial();
            }

            CancelInvoke("HintOrTaunt");

            if (currentTurn == 0 && !roundEnded)
            {
                bubble.CheckQueuedMessages();
                Invoke("HintOrTaunt", Random.Range(5f, 20f));
            }

            if (currentTurn == 1 && !roundEnded)
            {
                OpponentTurn();
            }

            if (!roundEnded)
            {
                locked = false;
            }
            else
            {
                AudioManager.Instance.Highpass(true);
            }
        }
    }