Skip to content

Instantly share code, notes, and snippets.

@judeibe
Created March 15, 2011 22:36
Show Gist options
  • Select an option

  • Save judeibe/871660 to your computer and use it in GitHub Desktop.

Select an option

Save judeibe/871660 to your computer and use it in GitHub Desktop.
// Loop through all tiles on map
for (TiledLayer layer : map.layers) {
for (int row = 0; row < layer.height; row++) {
for (int col = 0; col < layer.width; col++) {
if (layer.tile[row][col] != 0) {
tileCount++;
if (!tilesOnMap.contains(layer.tile[row][col])) {
tilesOnMap.add(layer.tile[row][col]);
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment