From b40cd074bec34cde14fa97ca369e5d104c658392 Mon Sep 17 00:00:00 2001 From: WanderingPenwing Date: Sun, 6 Oct 2024 14:46:56 +0200 Subject: [PATCH] moving start screen --- src/main.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 4ac86a0..61fb427 100644 --- a/src/main.rs +++ b/src/main.rs @@ -495,12 +495,21 @@ fn player_input( fn start_menu_system( keys: Res>, - mut game_state: ResMut> + mut game_state: ResMut>, + mut player_query: Query<(&mut Player, &mut Transform)> ) { if keys.just_pressed(KeyCode::Space) { info!("start space"); game_state.set(GameState::Game); } + + + if let Ok((_player, mut transform)) = player_query.get_single_mut() { + let mut rotation = Quat::IDENTITY; + rotation *= Quat::from_rotation_y((PI / 6000.0) as f32); // Rotate by 3 degrees (PI/60 radians) + rotation *= Quat::from_rotation_x((-PI / 2000.0) as f32); // Rotate by -3 degrees + transform.rotation *= rotation; // Apply the rotation + } } fn game_buttons(