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 sounds when match events (robots moving, robot shooting the ball, ball coliding) occur #157

Open
Bollos00 opened this issue Mar 19, 2021 · 0 comments

Comments

@Bollos00
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Not exactly.

Describe the solution you'd like
The simulation would be more alive if we could implement the sound of the collisions on the game (between the robots, the ball and the walls); the sound of the robot wheels moving, the sound of the kicker of the robot when it kicks the ball, the roller and so on.

Describe alternatives you've considered
The sounds would stored on the resources/sounds directory and we would have a .qrc file to organize them. We could use QMediaPlayer to play the sounds.

For example, to play the sound of the ball being kicked by the robot, it would be something like:

    QMediaPlayer* player = new QMediaPlayer(this);
    player->setMedia(QUrl("qrc:resources/sounds/ball_kicked.mp3"));
    player->setVolume(vol); // Depends of the distance from the expector
    player->play();

Additional context
Nothing to add here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant