public void Start()
 {
     StaticCheckGame.reset();
     if (StaticMinigame3Controller.getReplay() == true)
     {
         instructionsPanel.SetActive(false);
     }
     StaticCheckGame.reset();
     if (StaticLanguage.getLanguage().Equals("portuguese"))
     {
         instructions.text            = "Organiza o frigorífico o máximo número de vezes dentro do tempo limite, movendos as comidas para o respetivo lugar seguindo estas regras:\n - Bebidas na porta;\n - Apenas os vegetais e frutas podem estar na secção inferior do frigorífico;\n - Na mesma secção apenas pode existir uma família de alimentos.";
         instructionHighscoreSub.text = "Melhor Pontuação";
         gameEndHighscoreSub.text     = "Melhor Pontuação";
     }
     else
     {
         instructions.text            = "Organize the fridge, as many times as you can within the time limit, moving the foods to their respective places following these rules:\n - Drinks on the door;\n - Only vegetables and fruits can stay on the lower section of the fridge;\n - On the same section there can only be one food family.";
         instructionHighscoreSub.text = "Highscore";
         gameEndHighscoreSub.text     = "Highscore";
     }
     if (!System.IO.File.Exists(Application.persistentDataPath + "/sendToServer"))
     {
         sendToServer = new SendToServer();
     }
     else
     {
         sendToServer = FileManager.ReadFromBinaryFile <SendToServer> (Application.persistentDataPath + "/sendToServer");
     }
     highscore.text = "" + sendToServer.minigame2Highscore;
     setFoods();
 }
Beispiel #2
0
    public void Start()
    {
        if (StaticMinigame3Controller.getReplay() == true)
        {
            instructionsPanel.SetActive(false);
        }

        StaticMinigame3Controller.setReplay(false);
    }
Beispiel #3
0
    public void Start()
    {
        if (StaticMinigame3Controller.getReplay() == true)
        {
            instructionsPanel.SetActive(false);
        }

        if (StaticLanguage.getLanguage().Equals("portuguese"))
        {
            instructions.text            = "Em cada ronda, escolhe a comida que deves levar na lancheira. A cada resposta correta ganharás 1 ponto.";
            instructionHighscoreSub.text = "Melhor Pontuação";
            gameEndHighscoreSub.text     = "Melhor Pontuação";
        }
        else
        {
            instructions.text            = "In each round, choose the food you should take on your lunchbox. Each correct answear awards you with 1 point.";
            instructionHighscoreSub.text = "Highscore";
            gameEndHighscoreSub.text     = "Highscore";
        }

        if (!System.IO.File.Exists(Application.persistentDataPath + "/sendToServer"))
        {
            sendToServer = new SendToServer();
        }
        else
        {
            sendToServer = FileManager.ReadFromBinaryFile <SendToServer> (Application.persistentDataPath + "/sendToServer");
        }
        time.text  = roundTime.ToString();
        score.text = scoreNumber.ToString();

        highscore.text = "" + sendToServer.minigame3Highscore;

        healthyIngredients = new List <string> ()
        {
            "banana_0", "carrot_0", "cucumber_0", "grapes_0", "kiwi_0", "orange_0", "pear_0", "sandwich_0", "tomato_0"
        };
        unhealthyIngredients = new List <string> ()
        {
            "candy_1", "candyStick_1", "hamburger_1", "hotdog_1", "pizza_1", "popcorn_1"
        };

        choice1.onClick.AddListener(delegate {
            taskOnClick(choice1);
        });

        choice2.onClick.AddListener(delegate {
            taskOnClick(choice2);
        });

        setIngredients();
    }
    public void Start()
    {
        if (StaticLanguage.getLanguage().Equals("portuguese"))
        {
            legumesText.text   = "Legumes e Verduras";
            hidratosText.text  = "Hidratos de Carbono";
            proteinaVText.text = "Proteína Vegetal";
            proteinaAText.text = "Proteína Animal";
            frutaText.text     = "Frutas";
        }
        else
        {
            legumesText.text   = "Vegetables";
            hidratosText.text  = "Carbohydrates";
            proteinaVText.text = "Vegetable Protein";
            proteinaAText.text = "Animal Protein";
            frutaText.text     = "Fruits";
        }
        if (StaticMinigame3Controller.getReplay() == true)
        {
            instructionsPanel.SetActive(false);
        }
        StaticCheckGame.reset();
        if (StaticLanguage.getLanguage().Equals("portuguese"))
        {
            instructions.text            = "Organiza o teu prato, o máximo número de vezes dentro do tempo limite, movendo as comidas para o seu respetivo lugar.";
            instructionHighscoreSub.text = "Melhor Pontuação";
            gameEndHighscoreSub.text     = "Melhor Pontuação";
        }
        else
        {
            instructions.text            = "Organize your plate, as many times as you can within the time limit, moving the foods to their respective places.";
            instructionHighscoreSub.text = "Highscore";
            gameEndHighscoreSub.text     = "Highscore";
        }
        if (!System.IO.File.Exists(Application.persistentDataPath + "/sendToServer"))
        {
            sendToServer = new SendToServer();
        }
        else
        {
            sendToServer = FileManager.ReadFromBinaryFile <SendToServer> (Application.persistentDataPath + "/sendToServer");
        }
        time.text  = "" + roundTime;
        score.text = "" + scoreNumber;

        highscore.text = "" + sendToServer.minigame4Highscore;

        setIngredients();
    }
Beispiel #5
0
    public void Update()
    {
        if (gameOn || StaticMinigame3Controller.getReplay() == true)
        {
            roundTime -= Time.deltaTime;

            if (roundTime > 0)
            {
                time.text  = "" + (int)roundTime;
                score.text = scoreNumber.ToString();
            }
            else
            {
                gameEnd();
            }
        }
    }
    public void Update()
    {
        if (gameOn || StaticMinigame3Controller.getReplay() == true)
        {
            roundTime -= Time.deltaTime;

            if (roundTime > 0)
            {
                time.text  = "" + (int)roundTime;
                score.text = "" + scoreNumber;
            }
            else
            {
                gameEnd();
            }

            if (inventory.transform.childCount == 0)
            {
                setReplayFalse();
                gameOn = true;
                StaticCheckGame.setGameEndedTrue();
                if (StaticCheckGame.getSlotsChecked() == 5)
                {
                    if (StaticCheckGame.getGameWin() == false)
                    {
                        wrong.gameObject.SetActive(true);
                        correct.gameObject.SetActive(false);
                        gameOn = false;
                        StartCoroutine(nextRound());
                    }
                    else
                    {
                        correct.gameObject.SetActive(true);
                        wrong.gameObject.SetActive(false);
                        scoreNumber++;
                        gameOn = false;
                        StartCoroutine(nextRound());
                    }
                }
            }
        }
    }
Beispiel #7
0
 public void setReplayFalse()
 {
     StaticMinigame3Controller.setReplay(false);
 }
Beispiel #8
0
 public void setReplayTrue()
 {
     StaticMinigame3Controller.setReplay(true);
 }