craigmayhew/game-of-life

Add music to the game

craigmayhew opened this issue · 1 comments

At some point we may have a soundtrack. Here is some code for that.

use bevy::prelude::*;

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .add_startup_system(setup)
        .run();
}

fn setup(asset_server: Res<AssetServer>, audio: Res<Audio>) {
    let music = asset_server.load("sounds/Windless soundtrack.ogg");
    audio.play(music);
}

Music was added in 5901126 thanks to Anthony Howell!