Exemple #1
0
 public void LoseHealth()
 {
     Health--;
     if (Health <= 0)
     {
         pause.DoGameOver("You died!\n(Hint: Grab stars to restore health!)");
     }
 }
Exemple #2
0
    public void CompleteStar(int instanceId)
    {
        if (bigStar.gameObject.GetInstanceID() == instanceId)
        {
            pause.DoGameOver(string.Format(GAME_OVER_TEXT, this.timer.GetTimeFormatted()));
            return;
        }
        health.GainHealth();
        dict[instanceId].SetColor(false);
        dict.Remove(instanceId);

        if (dict.Count == 0)
        {
            bigStar.ActivateStar();
        }
    }
Exemple #3
0
    private IEnumerator StartAssigningTasks()
    {
        int highestPossibleScore = 0;

        yield return(new WaitForSeconds(timeUntilFirstTaskIsAssigned));

        foreach (TaskBundle task in tasksToDo)
        {
            Waypoint[] waypoints = current.GetRandomWaypoints(task.NumberOfTasks);
            foreach (Waypoint waypoint in waypoints)
            {
                highestPossibleScore += scorePerTask;
                AddTask(task.SecondsPerTask, waypoint, waypoint.WaypointName, scorePerTask);
            }
            yield return(new WaitForSeconds(task.SecondsUntilNextTaskGroup));
        }
        pause.DoGameOver("null"); // FIXME
    }