examples/blocks: Bug fix: ESC key caused crashing

This commit is contained in:
Hajime Hoshi 2020-03-29 02:35:58 +09:00
parent 231edfbd3f
commit b7d555e724

View File

@ -38,6 +38,7 @@ func (s *GamepadScene) Update(state *GameState) error {
if inpututil.IsKeyJustPressed(ebiten.KeyEscape) { if inpututil.IsKeyJustPressed(ebiten.KeyEscape) {
state.Input.gamepadConfig.Reset() state.Input.gamepadConfig.Reset()
state.SceneManager.GoTo(&TitleScene{}) state.SceneManager.GoTo(&TitleScene{})
return nil
} }
if s.buttonStates == nil { if s.buttonStates == nil {