craigmayhew / game-of-life

Game of Life, in 3D, using Bevy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add music to the game

craigmayhew opened this issue · 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!