예제 #1
0
 public Tile GetTile(int x, int y)
 {
     if (InRange(x, y) && InRange(x, y))
     {
         return(tiles[x, y]);
     }
     return(World.GetTile(pos.x + x, pos.y + y));
 }
    public void GenerateCaves(TileWorld world)
    {
        map = tileCaveGen.GenerateMap(TileWorld.WorldSizeInPixelsX, TileWorld.WorldSizeInPixelsY);

        for (int xi = 0; xi < TileWorld.WorldSizeInPixelsX; xi++)
        {
            for (int yi = 0; yi < TileWorld.WorldSizeInPixelsY; yi++)
            {
                if (map[xi, yi] != 1)
                {
                    if (world.GetTile((-TileWorld.WorldX * 16 + xi) + 1, -TileWorld.WorldY * 16 + yi).Type != Tile.TileType.Dirt)
                    {
                        world.SetTile(-TileWorld.WorldX * 16 + xi, -TileWorld.WorldY * 16 + yi, new TileAir());
                    }
                }
            }
        }
    }
    public void GenerateCaves(TileWorld world)
    {
        map = tileCaveGen.GenerateMap(TileWorld.WorldSizeInPixelsX, TileWorld.WorldSizeInPixelsY);

        for (int xi = 0; xi < TileWorld.WorldSizeInPixelsX; xi++)
        {
            for (int yi = 0; yi < TileWorld.WorldSizeInPixelsY; yi++)
            {
                if (map[xi, yi] != 1)
                {
                    if (world.GetTile((-TileWorld.WorldX * 16 + xi) + 1, -TileWorld.WorldY * 16 + yi).Type != Tile.TileType.Dirt)
                    {
                        world.SetTile(-TileWorld.WorldX * 16 + xi, -TileWorld.WorldY * 16 + yi, new TileAir());
                    }
                }
            }
        }
    }