func (o *Options) events(music openal.Source) { if control.keys[VK_ESC] { o.active = 0 storage.save_player() game.state = MENU } if control.keys[VK_ENTER] { if !control.enter_lock { control.enter_lock = true switch o.active { case 0: play_menu_click() game.music = !game.music if game.music { if !musicThread { go play_music(music) musicThread = true } else { music.Play() } } else { music.Pause() } case 1: play_menu_click() game.sound = !game.sound } } } else { control.enter_lock = false } if control.IsDownPressed() { if !control.down_lock { play_menu_click() control.down_lock = true o.active = 2 } } else { control.down_lock = false } if control.IsUpPressed() { if !control.up_lock { play_menu_click() control.up_lock = true o.active = 0 } } else { control.up_lock = false } if control.IsLeftPressed() { if !control.left_lock { control.left_lock = true switch o.active { case 2: if plane.boost != 5 { plane.boost-- play_menu_click() } default: if o.active != 0 { play_menu_click() } o.active = 0 } } } else { control.left_lock = false } if control.IsRightPressed() { if !control.right_lock { control.right_lock = true switch o.active { case 2: if plane.boost != 15 { plane.boost++ play_menu_click() } default: if o.active != 1 { play_menu_click() } o.active = 1 } } } else { control.right_lock = false } }