Exemple #1
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.RightArrow))
     {
         gymMachineListener.SimulateRightRep(1, 20, 500);
     }
     if (Input.GetKeyDown(KeyCode.LeftArrow))
     {
         gymMachineListener.SimulateLeftRep(1, 20, 500);
     }
 }
    // Move to the target end position.
    private void Update()
    {
        if (GameStartLabyrintti.LabyrinttiGameStarted)
        {
            if (!movement)
            {
                if (Input.GetKeyDown(KeyCode.DownArrow))
                {
                    if (GameObject.Find("Pimennys").GetComponent <DarknessScriptLabyrintti>().startGameTimer < 0)
                    {
                        PlayerMovement(MovementDirection.Down);
                    }
                }

                if (Input.GetKeyDown(KeyCode.LeftArrow))
                {
                    gymMachineListener.SimulateLeftRep(1, 20, 500);
                }

                if (Input.GetKeyDown(KeyCode.RightArrow))
                {
                    gymMachineListener.SimulateRightRep(1, 20, 500);
                }
            }

            if (isTimerRunnig)
            {
                targetTime += Time.deltaTime;

                if (targetTime >= combinedPullTimeDelay)
                {
                    movement = true;
                    PlayerMovement(isLeftRep ? MovementDirection.Left : MovementDirection.Right);
                    ResetMovementVariables();
                }

                if (isLeftRep && isRightRep)
                {
                    movement = true;
                    PlayerMovement(MovementDirection.Down);
                    ResetMovementVariables();
                }
            }

            MovementHandling();
        }
    }
Exemple #3
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.LeftArrow))
        {
            gymMachineListener.SimulateLeftRep(1, 20, 500);
        }
        if (Input.GetKeyDown(KeyCode.RightArrow))
        {
            gymMachineListener.SimulateRightRep(1, 20, 500);
        }
        if (Input.GetKeyDown(KeyCode.DownArrow))
        {
            MovingMiddle = true;
        }
        LeftPunch();
        RightPunch();
        MiddlePunch();
        FistAnimationController();

        HandleRepetitionLogic();
    }
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.RightArrow))
        {
            gymMachineListener.SimulateRightRep(1, 20, 500);
        }

        if (Input.GetKeyDown(KeyCode.LeftArrow))
        {
            gymMachineListener.SimulateLeftRep(1, 20, 500);
        }
        if (Input.GetKeyDown(KeyCode.DownArrow) || confirmingSelection)
        {
            if (gymMachineListener != null)
            {
                cancelTokenSource.Cancel();
            }

            if (mode1.enabled == true)
            {
                SceneManager.LoadScene("NyrkkiMain");
            }
            else if (mode2.enabled == true)
            {
                SceneManager.LoadScene("NyrkkiEndless");
            }
            else if (mode3.enabled == true)
            {
                SceneManager.LoadScene("NyrkkiUncensored");
            }
        }

        switch (chosenMenuOption)
        {
        case 0:
            mode1.enabled            = true;
            mode1Instruction.enabled = true;
            mode2.enabled            = false;
            mode2Instruction.enabled = false;
            mode3.enabled            = false;
            mode3Instruction.enabled = false;
            break;

        case 1:
            mode1.enabled            = false;
            mode1Instruction.enabled = false;
            mode2.enabled            = true;
            mode2Instruction.enabled = true;
            mode3.enabled            = false;
            mode3Instruction.enabled = false;
            break;

        case 2:
            mode1.enabled            = false;
            mode1Instruction.enabled = false;
            mode2.enabled            = false;
            mode2Instruction.enabled = false;
            mode3.enabled            = true;
            mode3Instruction.enabled = true;
            break;
        }
        HandleRepetitionLogic();
    }
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.RightArrow))
        {
            gymMachineListener.SimulateRightRep(1, 20, 500);
        }

        if (Input.GetKeyDown(KeyCode.LeftArrow))
        {
            gymMachineListener.SimulateLeftRep(1, 20, 500);
        }
        if (Input.GetKeyDown(KeyCode.DownArrow) || confirmingSelection)
        {
            if (game1.enabled == true)
            {
                SceneManager.UnloadSceneAsync("MainMenu");
                SceneManager.LoadScene("HyppyYlosMain");
            }
            else if (game2.enabled == true)
            {
                PlayerPrefs.SetInt("LabyrinttiLevel", 1);
                if (gymMachineListener != null)
                {
                    cancelTokenSource.Cancel();
                }
                // SceneManager.UnloadSceneAsync("MainMenu");
                SceneManager.LoadScene("MenuLabyrinttiMode");
            }
            else if (game3.enabled == true)
            {
                SceneManager.UnloadSceneAsync("MainMenu");
                SceneManager.LoadScene("MenuNyrkkiMode");
            }
            else if (credits.enabled == true)
            {
                SceneManager.LoadScene("Credits");
            }
        }

        switch (chosenMenuOption)
        {
        case 0:
            game1.enabled       = true;
            game2.enabled       = false;
            game3.enabled       = false;
            background1.enabled = true;
            background2.enabled = false;
            background3.enabled = false;
            background4.enabled = false;
            credits.enabled     = false;
            break;

        case 1:
            game1.enabled       = false;
            game2.enabled       = true;
            game3.enabled       = false;
            background1.enabled = false;
            background2.enabled = true;
            background3.enabled = false;
            background4.enabled = false;
            credits.enabled     = false;
            break;

        case 2:
            game1.enabled       = false;
            game2.enabled       = false;
            game3.enabled       = true;
            background1.enabled = false;
            background2.enabled = false;
            background3.enabled = true;
            background4.enabled = false;
            credits.enabled     = false;
            break;

        case 3:
            game1.enabled       = false;
            game2.enabled       = false;
            game3.enabled       = false;
            background1.enabled = false;
            background2.enabled = false;
            background3.enabled = false;
            background4.enabled = true;
            credits.enabled     = true;
            break;
        }
        HandleRepetitionLogic();
    }
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.RightArrow))
        {
            gymMachineListener.SimulateRightRep(1, 20, 500);
        }

        if (Input.GetKeyDown(KeyCode.LeftArrow))
        {
            gymMachineListener.SimulateLeftRep(1, 20, 500);
        }
        if (Input.GetKeyDown(KeyCode.DownArrow) || confirmingSelection)
        {
            string level = "";

            if (mode1.enabled == true)
            {
                level = "LabyrinttiLevel1";
            }
            else if (mode2.enabled == true)
            {
                level = "LabyrinttiLevel2";
            }
            else if (mode3.enabled == true)
            {
                level = "LabyrinttiRandomLevel";
            }

            LoadLabyrinttiLevel(level);
        }

        switch (chosenMenuOption)
        {
        case 0:
            mode1.enabled            = true;
            mode1Instruction.enabled = true;
            mode2.enabled            = false;
            mode2Instruction.enabled = false;
            mode3.enabled            = false;
            mode3Instruction.enabled = false;
            break;

        case 1:
            mode1.enabled            = false;
            mode1Instruction.enabled = false;
            mode2.enabled            = true;
            mode2Instruction.enabled = true;
            mode3.enabled            = false;
            mode3Instruction.enabled = false;
            break;

        case 2:
            mode1.enabled            = false;
            mode1Instruction.enabled = false;
            mode2.enabled            = false;
            mode2Instruction.enabled = false;
            mode3.enabled            = true;
            mode3Instruction.enabled = true;
            break;
        }
        HandleRepetitionLogic();
    }