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();
                }
            }
        }
示例#2
0
 public static LevelGame GetInstance()
 {
     if (_instance == null)
     {
         _instance = new LevelGame();
     }
     return(_instance);
 }
示例#3
0
        private void NewGame(LevelGame levelGame)
        {
            _learning              = true;
            translateList.Visible  = false;
            translateLabel.Visible = true;
            enterButton.Enabled    = true;

            GameController.InitGame(levelGame);
            NextLearningWord();
        }
示例#4
0
        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);
        }
示例#5
0
    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);
    }
示例#6
0
 // 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;
         }
     }
 }
示例#7
0
        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();
        }
示例#8
0
 void SetLevelChosen()
 {
     LevelGame.GetInstance().SetLevel(currentLevel);
 }
示例#9
0
 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;
 }