from eventutils import event_handler, EventDispatcher, EventHandlerMixin
from cursors import WarpingCursor
from config import FRAMERATE
from eventutils import event_handler, EventDispatcher, EventHandlerMixin
from cursors import WarpingCursor
from config import FRAMERATE
from globals import BACKGROUND_LAYER
from globals import FOREGROUND_LAYER
from globals import CURSOR_LAYER
from globals import BACKGROUND_LAYER
from globals import FOREGROUND_LAYER
from globals import CURSOR_LAYER
- instruments = ['accordeon', 'celesta', 'flute', 'guitare', 'orgue', 'piano', 'tuba', 'violon', 'violoncelle']
+ instruments = INSTRUMENTS
for y in range(self.cols) :
for x in range(self.rows) :
upperLeftCorner = (x * tileWidth, y * tileHeight)
rect = pygame.Rect(upperLeftCorner, (tileWidth, tileHeight))
for y in range(self.cols) :
for x in range(self.rows) :
upperLeftCorner = (x * tileWidth, y * tileHeight)
rect = pygame.Rect(upperLeftCorner, (tileWidth, tileHeight))
tile = InstrumentTile(instrus.pop(0), self, rect, (x,y))
self.add(tile, layer=BACKGROUND_LAYER)
self.tiles.append(tile)
tile = InstrumentTile(instrus.pop(0), self, rect, (x,y))
self.add(tile, layer=BACKGROUND_LAYER)
self.tiles.append(tile)
def onMouseMove(self, event) :
for tile in reversed(self.sprites()[:-1]) :
if tile.rect.collidepoint(*event.pos) :
def onMouseMove(self, event) :
for tile in reversed(self.sprites()[:-1]) :
if tile.rect.collidepoint(*event.pos) :
def selectInstrument(self, event) :
for tile in reversed(self.sprites()[:-1]) :
if tile.rect.collidepoint(*event.pos) :
def selectInstrument(self, event) :
for tile in reversed(self.sprites()[:-1]) :
if tile.rect.collidepoint(*event.pos) :
- def __init__(self, name, group, rect, coords) :
+ def __init__(self, instrumentDescription, group, rect, coords) :