blocl sound

This commit is contained in:
CoCo_Sol 2023-10-30 22:09:31 +01:00
parent 2257adc332
commit b99473fb00
3 changed files with 13 additions and 11 deletions

BIN
assets/sounds/block.wav Normal file

Binary file not shown.

BIN
assets/sounds/skweak1.ogg Normal file

Binary file not shown.

View file

@ -372,17 +372,19 @@ def __move_directories(world: World):
# On trouve l'autre dossier
for entity in world.query(DirectoryPosition, without=(Animation,)):
if (
entity != selected_entity
and entity[DirectoryPosition]
== DirectoryPosition(
if entity != selected_entity and entity[
DirectoryPosition
] == DirectoryPosition(
directory_position.x + movement[0],
directory_position.y + movement[1],
)
and BlockedDirectory not in entity
):
if BlockedDirectory not in entity:
other_directory = entity
break
else:
world.create_entity(Sound("block.wav"))
del entity[SelectedDirectory]
del world[SelectedDirectory]
else:
return
@ -395,7 +397,7 @@ def __move_directories(world: World):
selected_entity[DirectoryPosition].y += movement[1]
# On joue un son
world.create_entity(Sound("slide.wav"))
world.create_entity(Sound("slide.wav", 1))
# On retire le dossier selectionné
del world[SelectedDirectory]