simple transform animation

This commit is contained in:
Rendo 2026-01-25 15:08:16 +05:00
commit e17c712ec6
4 changed files with 35 additions and 1 deletions

View file

@ -1,3 +1,4 @@
use crate::animation::transform::AnimatedTransform;
use bevy::prelude::*;
pub mod drag;
@ -41,7 +42,7 @@ fn hand_setup(mut commands: Commands, asset_server: Res<AssetServer>) {
}
fn card_arrange(
query: Query<(Entity, &mut Transform, &Sprite, &ChildOf), With<Card>>,
query: Query<(Entity, &mut AnimatedTransform, &Sprite, &ChildOf), With<Card>>,
hand: Single<(Entity, &Children), With<Hand>>,
assets: Res<Assets<Image>>,
) {
@ -67,6 +68,7 @@ fn card_add(
commands.spawn((
Sprite::from_image(card_image.0.clone()),
Transform::from_xyz(0., 0., 0.),
AnimatedTransform::from_xyz(0., 0., 0.),
Card,
ChildOf(hand.entity()),
));