Need the hit.wav to be mono, but now we have a sound we can move around, just not sure how to place it based on the visuals.

This commit is contained in:
Zed A. Shaw 2024-10-28 19:46:55 -04:00
parent 9102bdc8ad
commit 4ed06b10b1
11 changed files with 144 additions and 41 deletions

View file

@ -62,9 +62,6 @@ GUI::GUI() :
{
$font.loadFromFile("./assets/text.otf");
resize_map(BASE_MAP_FONT_SIZE);
int res = $hit_buf.loadFromFile("./assets/hit.wav");
dbc::check(res, "failed to load hit.wav");
$hit_sound.setBuffer($hit_buf);
$ui_text.setFont($font);
$ui_text.setPosition(0,0);
@ -261,7 +258,6 @@ void GUI::draw_screen(bool clear, float map_off_x, float map_off_y) {
}
void GUI::shake() {
$hit_sound.play();
for(int i = 0; i < 10; ++i) {
int x = Random::uniform<int>(-10,10);
int y = Random::uniform<int>(-10,10);
@ -318,6 +314,10 @@ void GUI::render_scene() {
}
int GUI::main() {
SoundManager sounds("./assets");
sounds.load("hit", "hit.wav");
$world.set<SoundManager>(sounds);
configure_world();
create_renderer();
run_systems();