Reset color

This commit is contained in:
2026-09-16 19:26:58 +02:00
parent ef6af27a02
commit 9a97a2ba3e
+5 -2
View File
@@ -57,11 +57,14 @@ pub(crate) fn move_player(
// Reset player position
fn reset_player(
mut player: Single<&mut Transform, With<Player>>,
mut player: Single<(&mut Transform, &mut Sprite), With<Player>>,
input: Res<ButtonInput<KeyCode>>,
) {
let (mut transform, mut sprite) = player.into_inner();
if input.pressed(KeyCode::KeyR) {
player.translation = Vec3::new(START_POSITION.0, START_POSITION.1, START_POSITION.2);
transform.translation = Vec3::new(START_POSITION.0, START_POSITION.1, START_POSITION.2);
sprite.color = Color::WHITE
}
}