use gamestates and assetloader

This commit is contained in:
2025-03-26 02:18:40 +01:00
parent 9842148010
commit ac87da83d8
25 changed files with 245 additions and 123 deletions

View File

@@ -0,0 +1,20 @@
use bevy::prelude::*;
use ops::sin;
#[derive(Component, Reflect)]
#[reflect(Component)]
pub struct SquishAnimation(pub f32);
pub fn plugin(app: &mut App) {
app.add_systems(Update, update);
}
fn update(mut query: Query<(&mut Transform, &SquishAnimation)>, time: Res<Time>) {
for (mut transform, keymesh) in query.iter_mut() {
transform.scale = Vec3::new(
keymesh.0,
keymesh.0 + (sin(time.elapsed_secs() * 6.) * 0.2),
keymesh.0,
);
}
}