// Start is called before the first frame update
 void Start()
 {
     sound       = GetComponent <AudioSource>();
     body        = GetComponentInChildren <Rigidbody>();
     soundPlayed = false;
     gameMode    = transform.parent.parent.parent.parent.gameObject.GetComponent <GlobalScore>();
 }
Exemplo n.º 2
0
    private void Start()
    {
        texts = FindObjectsOfType <Text>();

        for (int h = 0; h < 4; h++)
        {
            if (texts[h].CompareTag("WinText"))
            {
                winText = texts[h];
            }
            if (texts[h].CompareTag("Player1ScoreText"))
            {
                Player1ScoreText = texts[h];
            }
            if (texts[h].CompareTag("Player2ScoreText"))
            {
                Player2ScoreText = texts[h];
            }
            if (texts[h].CompareTag("RestartText"))
            {
                restartText = texts[h];
            }
        }

        globalScore = FindObjectOfType <GlobalScore>();
    }
 public void RestartLevel()
 {
     GlobalScore.Restart();
     scoreController.DisableTables();
     Time.timeScale = 1;
     SceneManager.LoadScene(SceneManager.GetActiveScene().name);
 }
Exemplo n.º 4
0
    public void Initialize(Timer gameTimer, int healthyFood, int unhealthyFood)
    {
        scoreText.text = "Time: " + gameTimer.toString() + "\n" +
                         "Healthy Food Grabbed: " + healthyFood + "\n" +
                         "Unhealthy Food Grabbed: " + unhealthyFood + "\n" +
                         "Final Score: " + (healthyFood - unhealthyFood);


        GlobalScore.addScore(healthyFood - unhealthyFood);
    }
Exemplo n.º 5
0
 void Awake()
 {
     if (Instance == null)
     {
         DontDestroyOnLoad(gameObject);
         Instance = this;
     }
     else if (Instance != this)
     {
         Destroy(gameObject);
     }
 }
Exemplo n.º 6
0
    // Use this for initialization
    void OnEnable()
    {
        convertElapsedTime();

        scoreText.text = "Time: " + minutes + " minutes and " + seconds + " seconds" + "\n\n" +
                         "Check Fields Completed: " + Controller.blanksFilled + "\n\n" +
                         "Whole Checks Completed: " + Controller.checksCompleted + "\n\n" +
                         "Total Score: " + (Controller.blanksFilled + 5 * Controller.checksCompleted);

        GlobalScore.addScore(Controller.blanksFilled + (5 * Controller.checksCompleted));
        //GlobalScore.score += Controller.blanksFilled + (5*Controller.checksCompleted);
    }
Exemplo n.º 7
0
 // Start is called before the first frame update
 void Awake()
 {
     DontDestroyOnLoad(this.gameObject);
     if (PlayerScore == null)
     {
         DontDestroyOnLoad(this.gameObject);
         PlayerScore = this;
     }
     else if (PlayerScore != this)
     {
         Destroy(gameObject);
     }
 }
Exemplo n.º 8
0
    private void Start()
    {
        rb = GetComponent <Rigidbody>();

        // Get the force that is holding the player upright
        SpringJoint joint = GetComponent <SpringJoint>();
        Rigidbody   connectedComponent = joint.connectedBody;

        objectForce = connectedComponent.GetComponent <ConstantForce>();

        // Get the maximum y force that we can apply to the body to keep it upright
        maxYForce = objectForce.force.y;
        gameMode  = transform.parent.parent.parent.parent.gameObject.GetComponent <GlobalScore>();
    }
Exemplo n.º 9
0
    // Update is called once per frame
    void Update()
    {
        if (TFButton.isCorrect && !answered)
        {
            totalScore += 5;
            answered    = true;
            int score = 5;
            QuizScore.text = score.ToString();
            GlobalScore.addScore(5);
            TotalScore.text = totalScore.ToString();
        }

        TotalScore.text = totalScore.ToString();
    }
Exemplo n.º 10
0
    public void Initialize(Timer gameTimer, int healthyFood, int unhealthyFood)
    {
        healthyF                = healthyFood;
        unhealthyF              = unhealthyFood;
        localGameTimer          = gameTimer;
        HealthyFoodCount.text   = "x" + healthyFood.ToString();
        UnhealthyFoodCount.text = "x" + unhealthyFood.ToString();
        HealthyFoodScore.text   = healthyFood.ToString();
        UnhealthyFoodScore.text = "-" + unhealthyFood.ToString();



        GlobalScore.addScore(healthyFood - unhealthyFood);
    }
Exemplo n.º 11
0
    void UpdateUI()
    {
        if (debugPieceDraggedPosition && _draggedPiece != null)
        {
            Debug.Log("Piece dragged at pos " + _draggedPiece.transform.position.ToString());
        }
        string scoreText = LocalizationManager.Instance.GetLocString("score");
        string hsText    = LocalizationManager.Instance.GetLocString("highscore");

        textScore.text        = GlobalScore.ToString();
        textShuffleCount.text = _shuffleCount.ToString();
        textHighScore.text    = HighScore.ToString();
        textQuestsPoints.text = PlayerSettingsManager.Instance.QuestsPoints.ToString();
        DisplayCurrentQuest();
    }
    // Use this for initialization
    void Start()
    {
        teethCleaned = FinishButton.teethCleaned;
        convertElapsedTime();
        if (FinishButton.teethCleaned == numTeeth)
        {
            finishBonus = 10;
        }

        textToUpdate.text = "Total Time: " + minutes + " minutes and " + seconds + " seconds\n\n" +
                            "Teeth Cleaned: " + teethCleaned + "\n\n" +
                            "Finish Bonus: " + finishBonus + "\n\n" +
                            "Total Score: " + (teethCleaned + finishBonus);

        GlobalScore.addScore(teethCleaned + finishBonus);
    }
Exemplo n.º 13
0
    // Use this for initialization
    void Start()
    {
        m_StartButton.onClick.AddListener(StartGame);
        //m_StartButton.onClick.AddListener(OpenAboutPanel);
        m_StartButton.onClick.AddListener(QuitGame);

        if (m_Score != null)
        {
            if (GlobalScore.IsScoreSetOnce())
            {
                m_Score.text = "Score: " + GlobalScore.Score;
            }
            else
            {
                m_Score.text = "";
            }
        }
    }
Exemplo n.º 14
0
 public AnimeSearchItem(AnimeGeneralDetailsData data, bool anime = true) : this()
 {
     _item       = data;
     Id          = data.Id;
     GlobalScore = data.GlobalScore;
     AllEpisodes = data.AllEpisodes;
     if (!anime)
     {
         AllVolumes = data.AllVolumes;
     }
     Title               = data.Title;
     Type                = data.Type;
     Status              = data.Status;
     TxtType.Text        = Type;
     TxtTitle.Text       = Title;
     TxtGlobalScore.Text = GlobalScore.ToString("N2");
     TxtSynopsis.Text    = data.Synopsis;
     Img.Source          = new BitmapImage(new Uri(data.ImgUrl));
     WatchedEps.Text     = $"{(anime ? "Episodes" : "Chapters")} : {AllEpisodes}";
     _animeMode          = anime;
 }
Exemplo n.º 15
0
 public AnimeSearchItem(XElement animeElement, bool anime = true) : this()
 {
     item        = animeElement;
     Id          = int.Parse(animeElement.Element("id").Value);
     GlobalScore = float.Parse(animeElement.Element("score").Value);
     AllEpisodes = int.Parse(animeElement.Element(anime ? "episodes" : "chapters").Value);
     if (!anime)
     {
         AllVolumes = int.Parse(animeElement.Element("volumes").Value);
     }
     Title               = animeElement.Element("title").Value;
     Type                = animeElement.Element("type").Value;
     Status              = animeElement.Element("status").Value;
     TxtType.Text        = animeElement.Element("type").Value;
     TxtTitle.Text       = Title;
     TxtGlobalScore.Text = GlobalScore.ToString();
     TxtSynopsis.Text    = Utils.DecodeXmlSynopsisSearch(animeElement.Element("synopsis").Value);
     Img.Source          = new BitmapImage(new Uri(animeElement.Element("image").Value));
     WatchedEps.Text     = $"{(anime ? "Episodes" : "Chapters")} : {AllEpisodes}";
     _animeMode          = anime;
 }
Exemplo n.º 16
0
        private static void Main()
        {
            Logger.Level = LogLevel.Debug;
            Logger.RegisterReceiver(new ColoredConsoleLogger());
            Game.Mute();

            var score = new GlobalScore();

            foreach (var botPair in BotPairBuilder.GetAllBotPairs())
            {
                var firstBotKind  = botPair.FirstPlayer;
                var secondBotKind = botPair.SecondPlayer;

                var competitionConfiguration = new CompetitionConfiguration
                {
                    BotTurnLength = BotTurnLength,
                    FirstBotKind  = firstBotKind,
                    SecondBotKind = secondBotKind,
                    Height        = FieldHeight,
                    Width         = FieldWidth,
                    RunCount      = PairCompetitionCount
                };

                var competitionRunner = CompetitionRunner.CreateRunner(competitionConfiguration);
                if (competitionRunner == null)
                {
                    Logger.LogEntry("COMPETITION", LogLevel.Error, "Failed to create competition");
                    continue;
                }

                var competitionResult = competitionRunner.Run();
                score.Add(botPair, competitionResult);
                Logger.LogEntry("COMPETITION", LogLevel.Info, competitionResult.ToString());
            }

            score.Done();
            score.Print();
        }