Skip to content

Commit

Permalink
No more baal, now with ears
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelShaw committed Sep 3, 2016
1 parent 3de043e commit 80e26a7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Expand Up @@ -8,7 +8,7 @@ glium = { version = "0.15.0", features = ["glutin"] }
glutin = "0.6.1"
image = "0.10.1"
cgmath = "0.11.0"
baal = "0.3.0"
ears = "0.3.5"
multimap = "0.3.0"
rand = "0.3.14"

Expand Down
29 changes: 15 additions & 14 deletions src/main.rs
Expand Up @@ -7,6 +7,7 @@ extern crate glium;
extern crate glutin;
extern crate cgmath;
extern crate rand;
extern crate ears;

use gm2::*;
use gm2::game::simple;
Expand All @@ -21,24 +22,26 @@ use rand::Rng;

use std::collections::{VecDeque, HashSet};

fn main() {
let window = gm2::render::build_window(String::from("Grom"));
use ears::{Sound, AudioController};

let place_tile = String::from("place_tile");
let effect_names : HashSet<String> = [place_tile.clone()].iter().cloned().collect();
let audio_config = AudioConfiguration {
effect_directory: String::from("snd"),
music_directory: String::from("snd"),
fn play_file(file: &str) {
// Create a new Sound.
let mut snd = Sound::new(file).unwrap();

global_volume: 1.0,
// Play the Sound
snd.play();

effect_names: effect_names,
music_names: HashSet::new(),
};
// Wait until the end of the sound
while snd.is_playing() {}
}

let live_audio = init_audio(audio_config).unwrap();
fn main() {
let window = gm2::render::build_window(String::from("Grom"));

let place_tile = String::from("place_tile");
let effect_names : HashSet<String> = [place_tile.clone()].iter().cloned().collect();

play_file("snd/place_tile.ogg");

let tiles = grom::game::tile::produce_tile_set();

Expand Down Expand Up @@ -112,7 +115,6 @@ fn main() {
tile_id: tile_id,
snow: 0,
};
live_audio.play_effect(&place_tile, Vec3::new(0.0, 0.0, 0.0));
}
}

Expand All @@ -134,5 +136,4 @@ fn main() {
simple::Action::Continue
});

destroy(live_audio);
}

0 comments on commit 80e26a7

Please sign in to comment.