Exemple #1
0
    public CTileMap(string aFileName)
    {
        loadLevelTMX(aFileName);

        // Create the empty tile. Used to be returned when accessing out of the array.
        mEmptyTile = new CTile(0, 0, 0, mTiles [AIR_INDEX], 4);
        mEmptyTile.setVisible(false);
        mEmptyTile.setWalkable(true);

        registerSingleton();
    }
Exemple #2
0
    // Info con los items.
    //private CItemInfo mItemInfo;

    public CTileMap()
    {
        mTiles     = new Sprite [NUM_TILES];
        mTiles [0] = Resources.Load <Sprite> ("Sprites/tiles/tile000");
        mTiles [1] = Resources.Load <Sprite> ("Sprites/tiles/tile001");
        mTiles [2] = Resources.Load <Sprite> ("Sprites/tiles/tile002");
        mTiles [3] = Resources.Load <Sprite> ("Sprites/tiles/tile003");
        mTiles [4] = Resources.Load <Sprite> ("Sprites/tiles/tile004");
        mTiles [5] = Resources.Load <Sprite> ("Sprites/tiles/tile005");

        // TODO: CARGAR TODO JUNTO CON LOADALL.

        buildLevel(1);

        mEmptyTile = new CTile(0, 0, 0, mTiles [0]);
        mEmptyTile.setVisible(false);
        mEmptyTile.setWalkable(true);
    }
Exemple #3
0
    //Se cargan los sprites de los tiles
    //TODO hacer manager de assets
    public CTileMap()
    {
        mMapObject      = new GameObject();
        mMapObject.name = "Mapa";
        mTiles          = new Sprite[NUM_TILES];
        mTiles[0]       = Resources.Load <Sprite>("Sprites/tiles/tile000");
        mTiles[1]       = Resources.Load <Sprite>("Sprites/tiles/tile001");
        //mTiles[2] = Resources.Load<Sprite>("Sprites/tiles/wall002");

        /*mTiles[3] = Resources.Load<Sprite>("Sprites/tiles/tile003");
        *  mTiles[4] = Resources.Load<Sprite>("Sprites/tiles/tile004");
        *  mTiles[5] = Resources.Load<Sprite>("Sprites/tiles/tile005");*/

        //TODO: Cargar todo junto con LOADALL
        buildLevel(1);

        mEmptyTile = new CTile(0, 0, 0, mTiles[0]);
        mEmptyTile.setVisible(false);
        mEmptyTile.setWalkable(true);
    }