bevy/examples/audio/audio.rs
Nathan Stocks 9871e7e24b
Remove add_default_plugins and add MinimalPlugins for simple "headless" scenarios (#767)
Remove add_default_plugins and add MinimalPlugins for simple "headless" scenarios
2020-11-02 18:38:37 -08:00

15 lines
373 B
Rust

use bevy::prelude::*;
/// This example illustrates how to load and play an audio file
fn main() {
App::build()
.add_plugin_group(DefaultPlugins)
.add_startup_system(setup.system())
.run();
}
fn setup(asset_server: Res<AssetServer>, audio: Res<Audio>) {
let music = asset_server.load("sounds/Windless Slopes.mp3");
audio.play(music);
}