Exemplo n.º 1
0
 //Check the Distance between two Vectors
 private bool CheckDistance()
 {
     //if(Vector2.Distance(paintHead, playerHead) < distanceToCheck)
     if (playerUpPivot.position.y > pivotUp.position.y)
     {
         //Win Conditions here
         //Check if the player Win the Last CheckPoint
         if (lastPaintPail == true)
         {
             GameManager.instance.inLastCheckPoint = true;
         }
         OnGameOver?.Invoke(false);
         if (inCheckMode == true)
         {
             OnScoreIncrease?.Invoke(true, 1);
             inCheckMode = false;
         }
         return(true);
     }
     else
     {
         //Lose Conditions here
         OnGameOver?.Invoke(true);
         if (inCheckMode == true)
         {
             OnScoreIncrease?.Invoke(false, 0);
             inCheckMode = false;
         }
         return(false);
     }
 }
Exemplo n.º 2
0
    public async void AttemptWriteScore(Inventory inventory)
    {
        Score currentScore = inventory.ToScore();

        ScoreEntity scoreEntity = new ScoreEntity(SystemInfo.deviceUniqueIdentifier, SystemInfo.deviceName);

        scoreEntity.FromScore(currentScore);

        if (currentScore > maxScore)
        {
            Task <ScoreEntity> write = WriteScore(scoresTable, scoreEntity);

            UpdateLocalTable(scoreEntity);
            if (machineToNameMap.ContainsKey(SystemInfo.deviceName))
            {
                OnScoreIncrease?.Invoke();
            }

            await write;
        }
    }
Exemplo n.º 3
0
 public void IncreaseScore(int _value)
 {
     value += _value;
     OnScoreIncrease?.Invoke(this.value);
 }
Exemplo n.º 4
0
 public void AddNewAppleScore()
 {
     OnScoreIncrease?.Invoke(scoreIncrease: scorePerApple);
 }
Exemplo n.º 5
0
 public void AddNewKnifeScore()
 {
     OnScoreIncrease?.Invoke(scoreIncrease: scorePerKnife);
 }
Exemplo n.º 6
0
 public void IncreaseScore(int score) => OnScoreIncrease?.Invoke(score);