Beispiel #1
0
    void Awake()
    {
        instGroundManager = this;
        mapGround         = new mapValue[height * width];
        mapObjects        = new GameObject[height * width];
        for (int i = 0; i < mapObjects.Length; i++)
        {
            mapObjects [i] = null;
        }

        spawnPoints     = new Vector3[maxSpawnPoint];
        spawnPoints [0] = new Vector3(0f, 0.5f, 0f);
        spawnPoints [1] = new Vector3(width - 1, 0.5f, height - 1);
    }
Beispiel #2
0
    void Awake()
    {
        instLevelManager = this;
        gm           = GetComponent <GroundMaganger> ();
        players      = new GameObject [maxPlayer];
        scorePlayers = new int[maxPlayer];
        PCs          = new PlayerController [maxPlayer];
        strHighScore = PlayerPrefs.GetString(strSaveKey);
        if (strHighScore.Length == 0)
        {
            strHighScore = "High Score\n";
        }

        imageFlashScreen.SetActive(true);
        textPressToContinue.SetActive(true);
        timer       = 0;
        m_gameState = GameState.FlashScreen;
    }
Beispiel #3
0
 void Explose(int i, int j, Vector2 dir, int size)
 {
     Instantiate(prefExplotion, new Vector3(j, 0.5f, i), Quaternion.identity);
     if (size > 1)
     {
         int ni = (int)System.Math.Round(i + dir.x, 0);
         int nj = (int)System.Math.Round(j + dir.y, 0);
         GroundMaganger.mapValue v = GroundMaganger.GetInstance().GetMapValueAt(ni, nj);
         if (v != GroundMaganger.mapValue.metal && v != GroundMaganger.mapValue.brick)
         {
             Explose(ni, nj, dir, size - 1);
         }
         if (v == GroundMaganger.mapValue.brick)
         {
             GroundMaganger.GetInstance().DestroyAt(ni, nj);
         }
     }
 }