examples/blocks/blocks: Unify the terms 'abstract' and 'virtual'

This commit is contained in:
Hajime Hoshi 2021-07-20 03:02:37 +09:00
parent 5004fdcf02
commit d32b58d050
2 changed files with 4 additions and 4 deletions

View File

@ -232,7 +232,7 @@ func (s *GameScene) Update(state *GameState) error {
if s.gameover {
if inpututil.IsKeyJustPressed(ebiten.KeySpace) ||
anyGamepadAbstractButtonJustPressed(state.Input) {
anyGamepadVirtualButtonJustPressed(state.Input) {
state.SceneManager.GoTo(&TitleScene{})
}
return nil

View File

@ -39,7 +39,7 @@ type TitleScene struct {
count int
}
func anyGamepadAbstractButtonJustPressed(i *Input) bool {
func anyGamepadVirtualButtonJustPressed(i *Input) bool {
if !i.gamepadConfig.IsInitialized() {
return false
}
@ -59,12 +59,12 @@ func (s *TitleScene) Update(state *GameState) error {
return nil
}
if anyGamepadAbstractButtonJustPressed(state.Input) {
if anyGamepadVirtualButtonJustPressed(state.Input) {
state.SceneManager.GoTo(NewGameScene())
return nil
}
// If 'abstract' gamepad buttons are not set and any gamepad buttons are pressed,
// If 'virtual' gamepad buttons are not set and any gamepad buttons are pressed,
// go to the gamepad configuration scene.
if id := state.Input.GamepadIDButtonPressed(); id >= 0 {
g := &GamepadScene{}