From 290d54624896cda6520d2165f0830baed179d66f Mon Sep 17 00:00:00 2001 From: Gwilym Kuiper Date: Fri, 25 Jun 2021 22:01:50 +0100 Subject: [PATCH] Add lowering the volume to the example --- agb/examples/mixer_basic.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/agb/examples/mixer_basic.rs b/agb/examples/mixer_basic.rs index 4e6f483d..7b288633 100644 --- a/agb/examples/mixer_basic.rs +++ b/agb/examples/mixer_basic.rs @@ -5,7 +5,7 @@ extern crate agb; use agb::sound::mixer::SoundChannel; use agb::Gba; -use agb::input::{ButtonController, Tri}; +use agb::input::{ButtonController, Tri, Button}; use agb::number::Num; // Music - "I will not let you let me down" by Josh Woodward, free download at http://joshwoodward.com @@ -41,6 +41,12 @@ pub fn main() -> ! { Tri::Zero => channel.playback(1.into()), Tri::Positive => channel.playback(half_usize), }; + + if input.is_pressed(Button::L) { + channel.volume(half); + } else { + channel.volume(1.into()); + } } }