Function poke_a_mango::ops::state::tick_mango [] [src]

pub fn tick_mango(s: &mut GameState) -> Option<usize>

Tick the mango in Playing state.

Call this before displaying/updating the label of the mango button. Returns the original fruit.

If the supplied argument is not Playing, it remains unchanged.

Examples

let mut state = GameState::Playing {
    difficulty: Difficulty::Hard,
    score: 12,
    fruit: None,
};
let fruit = state::tick_mango(&mut state);
update_label(&mango_button, fruit_name(&fruit));