/** * Triggers all tiles with the specified ID * * @param id The tile ID to trigger * @param pressed True when the button is down */ public void trigger(int id, boolean pressed) { for (int y = 0; y < h; y++) { for (int x = 0; x < w; x++) { Tile b = tiles[x + y * w]; if (b.id == id) { b.trigger(pressed); } } } }