mirror of
https://github.com/italicsjenga/agb.git
synced 2025-01-26 00:56:38 +11:00
Add lowering the volume to the example
This commit is contained in:
parent
3c0d881a45
commit
290d546248
1 changed files with 7 additions and 1 deletions
|
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue