- self.change_layer(tile, FOREGROUND_LAYER)
- tile.inflate(tile.coords)
+ if not tile.inflated :
+ self.change_layer(tile, FOREGROUND_LAYER)
+ tile.inflate(tile.coords)
+
+ if self._inflatedTile :
+ self._inflatedTile.deflate()
+ self.change_layer(self._inflatedTile, BACKGROUND_LAYER)
+
+ self._inflatedTile = tile
+
+ @event_handler(pygame.MOUSEBUTTONDOWN)
+ def selectInstrument(self, event) :
+ for tile in reversed(self.sprites()[:-1]) :
+ if tile.rect.collidepoint(*event.pos) :
+ self.selectedInstrument = tile
+ self.stop()
+ break