fn gameover_keyboard(mut state: ResMut<State<GameState>>, keyboard_input: Res<Input<KeyCode>>) {
    if keyboard_input.just_pressed(KeyCode::Space) {
        state.set(GameState::Playing).unwrap();
    }
}
// restart the game when pressing spacebar
restart the game when pressing spacebar
restart the game when pressing spacebar
fn gameover_keyboard(mut state: ResMut<State<GameState>>, keyboard_input: Res<Input<KeyCode>>) {
    if keyboard_input.just_pressed(KeyCode::Space) {
        state.set(GameState::Playing).unwrap();
    }
}
fn gameover_keyboard ( mut state : ResMut < State < GameState > > , keyboard_input : Res < Input < KeyCode > > ) { if keyboard_input . just_pressed ( KeyCode :: Space ) { state . set ( GameState :: Playing ) . unwrap ( ) ; } }
restart the game when pressing spacebar
restart the game when pressing spacebar
state
ResMut<State<GameState>>
keyboard_input
Res<Input<KeyCode>>
state
ResMut<State<GameState>>
keyboard_input
Res<Input<KeyCode>>