moving start screen
This commit is contained in:
parent
6537bf1cec
commit
b40cd074be
11
src/main.rs
11
src/main.rs
|
@ -495,12 +495,21 @@ fn player_input(
|
|||
|
||||
fn start_menu_system(
|
||||
keys: Res<ButtonInput<KeyCode>>,
|
||||
mut game_state: ResMut<NextState<GameState>>
|
||||
mut game_state: ResMut<NextState<GameState>>,
|
||||
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(
|
||||
|
|
Loading…
Reference in a new issue