Function poke_a_mango::ops::state::select_difficulty
[−]
[src]
pub fn select_difficulty(s: &mut GameState, difficulty: Difficulty)
Press one of the Difficulty buttons in ChooseDifficulty
, transforming it into Exit
.
If the supplied argument is not ChooseDifficulty
, it remains unchanged.
Examples
let mut state = GameState::ChooseDifficulty; if difficulty_easy_button_pressed { state::select_difficulty(&mut state, Difficulty::Easy); } else if difficulty_normal_button_pressed { state::select_difficulty(&mut state, Difficulty::Normal); } else if difficulty_hard_button_pressed { state::select_difficulty(&mut state, Difficulty::Hard); }