public void NewGame(StartInfo startInfo) { this.ObjectSize = startInfo.ObjectsSize; this.AppleCount = startInfo.AppleCount; this.EnemiesCount = startInfo.EnemyCount; entities.apples = new List <Apple>(); entities.walls = new List <Wall>(); entities.enemies = new List <Enemy>(); entities.bullets = new List <Bullet>(); entities.playerBullet = new List <Bullet>(); initializeGame = new InitializeGame(entities); initializeGame.Initialize(ObjectSize, AppleCount, EnemiesCount); }
/* * void Update(){ * if (Input.GetKeyDown (KeyCode.C)) { * StartCoroutine (WinRound ()); * } * if (Input.GetKeyDown (KeyCode.Q)) { * StartCoroutine (GameOver()); * } * } */ IEnumerator StartRound() { CanvasAnim.SetTrigger("Intro"); gameInitializer.Initialize(); AnnouncmentText.text = Announcments [Random.Range(0, Announcments.Length)]; DayNumber.text = "Day " + roundNumber.ToString(); yield return(new WaitForSeconds(1f)); snd.clip = newsSnd; snd.Play(); yield return(new WaitForSeconds(2f)); if (roundNumber < 5) { timer = 20; } else if (roundNumber < 10) { timer = 10; } else if (roundNumber < 15) { timer = 5; } timertext.text = timer.ToString(); if (health == 3) { healthText.text = " "; } else if (health == 2) { healthText.text = "X"; } else if (health == 1) { healthText.text = "X X"; } yield return(new WaitForSeconds(1f)); timerinstance = StartCoroutine(TickTimer()); pc.canControl = true; //yield return new WaitForSeconds (1f); }