Add music

This commit is contained in:
crumblingstatue 2023-04-03 23:36:45 +02:00
parent 20409e3ee2
commit 69b022ea02
3 changed files with 6 additions and 2 deletions

View file

@ -1,13 +1,15 @@
use sfml::{graphics::Texture, SfBox};
use sfml::{audio::Music, graphics::Texture, SfBox};
pub struct Res {
pub tile_atlas: SfBox<Texture>,
pub music: Music<'static>,
}
impl Res {
pub fn load() -> anyhow::Result<Self> {
Ok(Self {
tile_atlas: Texture::from_file("res/tiles.png")?,
music: Music::from_file("res/music.ogg").unwrap(),
})
}
}