Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add music and sounds #2

Closed
felixmariotto opened this issue Aug 29, 2022 · 1 comment
Closed

Add music and sounds #2

felixmariotto opened this issue Aug 29, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@felixmariotto
Copy link
Owner

felixmariotto commented Aug 29, 2022

It would be nice to have sounds in the game, particularly when two puzzle parts get merged, and when a puzzle is finished.
A background ambient music would be nice too, or light crowd noises with lot of echo like in museums.

Here is where parts are merged :

if (
part.position.distanceTo( oppositePart.position ) < 0.07 &&
part.quaternion.angleTo( oppositePart.quaternion ) < 0.5
) {
// in here we do the actual merging of one part into the passed part.
for ( let i = oppositePart.children.length - 1 ; i > -1 ; i -- ) {
const child = oppositePart.children[i];
part.add( child );
}
const isFinished = ( part.children.length === this.pieces.length );
events.emit( 'parts-assembled', isFinished );
}

A event should be fired here with the events module, and this event should be listened in a new audio module.

@felixmariotto
Copy link
Owner Author

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant