use breeze::prelude::*;

#[derive(Default)]
struct MyGame;

impl Game for MyGame {
    fn update(&mut self, ctx: &mut Context) {
        // Logic & Input
        if ctx.input.key_pressed(KeyCode::Space) {

            // Created/distributed by Kenney (www.kenney.nl)
            // License: (Creative Commons Zero, CC0)
            ctx.audio.play_vol("switch_001.ogg", 0.2);
        }
    }

    fn draw(&mut self, ctx: &mut DrawContext) {
        ctx.clear_background(Color::from(DARK_SLATE_GRAY));

        ctx.with_layer(0, |ui| {
            ui.set_camera(CameraMode::default());
            ui.text.draw("Press Space to Play Sound Effect", -150.0, 0.0);
        });
    }
}

fn main() {
    run(AppConfig::default(), MyGame::default());
}