Skip to content

Added menu sound effects for select and click actions #20

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

harsh-k7
Copy link

@harsh-k7 harsh-k7 commented Jun 8, 2025

This pull request implements sound effects for menu interactions. The following changes have been made:

Integrated click.wav and select.wav into MenuConfig.

Added _click_sound for selection changes using Up/Down keys.

Added _select_sound for confirming menu choices using Return key.

Updated game_menu_impl.h and game_menu_impl.cpp to handle sound playback.

Ensured smooth functionality for menu navigation.

This enhancement aligns with issue #3 (Menu Sounds). Let me know if any adjustments are needed!

Copy link
Owner

@ParadoxZero ParadoxZero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for your PR!

I need a couple of changes before I can accept it -

  1. Please undo the auto formatted changes - use tab width as 2 for the project.
  2. Include the public headers which seem to be missing.
  3. Move the sample files to example - and update the example to set the sound config.

std::cout << " Processing item " << menu_item.name << std::endl;
Menu(sf::RenderTarget &window, MenuConfig config)
: _window(window), _style(config.style), _title(config.title) {
_click_sound.setBuffer(config.click_sound_effect);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you miss including the public header in your commit?

struct coordinates {
float x = 0;
float y = 0;
float x = 0;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lot of formatting changes - please don't do the auto format over the doc - I have the tab width set as 2 instead of 4 which is probably the cause.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put this sample audio next to the examples - Also add a readme with attribution and source of these assets.

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

Successfully merging this pull request may close these issues.

2 participants