pub fn wait_keypress(&mut self) {
        for event in self.event_pump.wait_iter() {
            match event {
                Event::KeyDown {
                    keycode: Some(Keycode::Escape),
                    ..
                } => break,
                Event::KeyUp {
                    keycode: Some(Keycode::Escape),
                    ..
                } => break,
                Event::Quit { .. } => std::process::exit(0),
                _ => {}
            }
        }
    }
// Wait for keypress; if a quit event is received (e.g. Alt+F4 or window close), the program will
// exit.
//
Wait for keypress; if a quit event is received , the program will
exit.
Wait for keypress ; if a quit event is received the program will exit .
pub fn wait_keypress(&mut self) {
        for event in self.event_pump.wait_iter() {
            match event {
                Event::KeyDown {
                    keycode: Some(Keycode::Escape),
                    ..
                } => break,
                Event::KeyUp {
                    keycode: Some(Keycode::Escape),
                    ..
                } => break,
                Event::Quit { .. } => std::process::exit(0),
                _ => {}
            }
        }
    }
pub fn wait_keypress ( & mut self ) { for event in self . event_pump . wait_iter ( ) { match event { Event :: KeyDown { keycode : Some ( Keycode :: Escape ) , .. } => break , Event :: KeyUp { keycode : Some ( Keycode :: Escape ) , .. } => break , Event :: Quit { .. } => std :: process :: exit ( 0 ) , _ => { } } } }
Wait for keypress; if a quit event is received (e.g.
Wait for keypress ; if a quit event is received ( e . g .
&mut self