private void Start() { currentGO = Instantiate(dummyPrefab) as GameObject; isGroundPlaced = false; isTombPlaced = false; gameManagerController = GameObject.FindWithTag("GameManager").GetComponent <GameManagerController>(); Level level = LevelGame.GetInstance().GetLevel(); float levelGame = level.GetDifficult(); if (levelGame == 0) { numOfTombsPlaced = 1; } else { numOfTombsPlaced = (int)levelGame * 2; } if (gameManagerController.isGameSetup == false) { if (!isGroundPlaced) { AllowPlaceGroundButton(); } } }
public static LevelGame GetInstance() { if (_instance == null) { _instance = new LevelGame(); } return(_instance); }
private void NewGame(LevelGame levelGame) { _learning = true; translateList.Visible = false; translateLabel.Visible = true; enterButton.Enabled = true; GameController.InitGame(levelGame); NextLearningWord(); }
private static Dictionary <string, string> GetWords(LevelGame levelGame) { Dictionary <string, string> result = new Dictionary <string, string>(); List <KeyValuePair <string, string> > tmp = DictionaryDataBase.Dictionary.ToList(); Shuffle(tmp); for (int i = 0; i < (int)levelGame; i++) { result.Add(tmp[i].Key, tmp[i].Value); } return(result); }
void RunGame() { Debug.Log(LevelGame.GetInstance().GetLevel().GetName()); ScoreManager.GetInstance().ResetScore(); IncreaseScore(0); isGameOver = false; timeLeft = playTime; player = GameObject.FindWithTag("MainCamera"); playerController = player.GetComponent <PlayerController>(); playerController.InitHp(playerHpMax); gun = GameObject.FindWithTag("Gun").GetComponent <GunController>(); UpdadtePlayerHP(); InvokeRepeating("UpdateTimeLeft", 0, 0.5f); }
// Update is called once per frame void Update() { if (!hasStartSpawn) { if (gameManagerController.isGamePlaying) { float i = 1; if (LevelGame.GetInstance().GetLevel().GetDifficult() != 0) { i = LevelGame.GetInstance().GetLevel().GetDifficult(); } InvokeRepeating("spawnZombie", 0, timeDelay / i); hasStartSpawn = true; } } }
public static void InitGame(LevelGame levelGame) { Dict = GetWords(levelGame); _itr = Dict.GetEnumerator(); CurrentGameStats = new GameStats(); CurrentListKey.Clear(); CurrentListValue.Clear(); foreach (var keyValuePair in Dict) { CurrentListKey.Add(keyValuePair.Key); CurrentListValue.Add(keyValuePair.Value); } Shuffle(CurrentListKey); Shuffle(CurrentListValue); _wordItr = CurrentListKey.GetEnumerator(); }
void SetLevelChosen() { LevelGame.GetInstance().SetLevel(currentLevel); }
void Start() { attackAudio = GetComponentInChildren<AudioSource> (); anim = GetComponent<Animator> (); game = GameObject.Find ("Levelgame").GetComponent<LevelGame> (); rageBar = GameObject.Find ("RageBar").GetComponent<Slider> (); rageBar.value = ragePoints; healthBar = GameObject.Find ("HealthBar").GetComponent<Slider> (); maxHealthPoints = healthPoints; healthBar.maxValue = maxHealthPoints; healthBar.value = healthPoints; destination = transform.position; }