code: private int countTiles(int widthInTile, int step, int s)
      {
          int count = 0;
          for (int tx = 0; tx < widthInTile; tx++)
          {
              for (int ty = 0; ty < map.getInTileHeight(); ty++)
              {
                  if (map.getTile(tx + s * step, ty) != null)
                  {
                      count++;
                  }
              }
          }
          return count;
      }
docs: Count the active tiles.
  
  @param widthInTile The horizontal tiles.
  @param step The step number.
  @param s The s value.
  @return The active tiles.