Add audio, select animation via help not working...

main
Elijah Voigt 1 year ago
parent f3b795f9c6
commit 035e4114ba

@ -0,0 +1,13 @@
use bevy::prelude::*;
pub struct AudioPlugin;
impl Plugin for AudioPlugin {
fn build(&self, app: &mut App) {
app.add_systems(Startup, load_audio);
}
}
fn load_audio(assets: Res<AssetServer>, mut commands: Commands) {
commands.spawn(AudioPlayer::new(assets.load("its-the-balatro-music.ogg")));
}

@ -124,16 +124,14 @@ impl Card {
}; };
(3 * shape_col) + number_col (3 * shape_col) + number_col
}; };
info!("Row: {:?} Col: {:?}", row, col); assert!(row < 12, "Sprite row should be less than 12");
assert!(row < 12); assert!(row > 2, "sprite row should be greater than 2");
assert!(row > 2); assert!(col < 9, "Sprite column should be less than 9");
assert!(col < 9);
// Figure out the sprite number based on row + col // Figure out the sprite number based on row + col
(9 * row) + col (9 * row) + col
}; };
info!("Index: {:?}", num); assert!(num < 108, "Sprite index should be less than 108");
assert!(num < 108);
let size = UVec2 { x: 20, y: 32 }; let size = UVec2 { x: 20, y: 32 };
let layout = TextureAtlasLayout::from_grid(size, 9, 12, None, None); let layout = TextureAtlasLayout::from_grid(size, 9, 12, None, None);

@ -1,3 +1,4 @@
mod audio;
mod boot; mod boot;
mod debug; mod debug;
mod deck; mod deck;
@ -24,13 +25,17 @@ fn main() {
}), }),
) )
.add_plugins(( .add_plugins((
view::ViewPlugin, audio::AudioPlugin,
deck::DeckPlugin,
boot::BootPlugin, boot::BootPlugin,
setup::SetupPlugin,
play::PlayPlugin,
menu::MenuPlugin, menu::MenuPlugin,
debug::DebugPlugin, play::PlayPlugin,
setup::SetupPlugin,
view::ViewPlugin,
deck::DeckPlugin,
{
#[cfg(debug_assertions)]
debug::DebugPlugin
},
)) ))
.init_state::<GameState>() .init_state::<GameState>()
.run(); .run();

@ -1,7 +1,6 @@
TODO: TODO:
* Better shuffling * Better shuffling
* Make "set" button visually interesting when 3 cards selected * Make "set" button visually interesting when 3 cards selected
* Use Animation for rotating cards
* Animate cards deck -> board * Animate cards deck -> board
* Animate cards deck -> set-pile * Animate cards deck -> set-pile

Loading…
Cancel
Save