Ejemplo n.º 1
0
    public Tile[,] tiles; // the tiles on the map

    #endregion Fields

    #region Methods

    // Use this for initialization
    void Start()
    {
        tiles = new Tile[worldWidth,worldHeight];
        for (int i=0; i<worldWidth;i++){
            for(int j=0; j<worldHeight;j++){
                GameObject tile = (GameObject)Instantiate(Tile);
                tiles[i,j]=(Tile)tile.GetComponent("Tile");
                tiles[i,j].init(i,j);
            }
        }//end of tile initialization

        playerVillage = new Village();
        playerVillage.init(tiles[Random.Range(0,worldWidth/2),Random.Range(0,worldHeight/2)]);
        enemyVillage = new Village();
        enemyVillage.init(tiles[Random.Range(0,worldWidth/2),Random.Range(0,worldHeight/2)]);
        caves=new ArrayList();
    }