Skip to content

Commit d1263ef

Browse files
committed
obstacle-race: PAD対応 修正2
1 parent 9316a90 commit d1263ef

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

11-obstacle-race/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def update(self):
101101
self.dy = min(self.dy + 1, 10)
102102

103103
# スペースキーの入力処理
104-
if pyxel.btn(pyxel.KEY_SPACE) or pyxel.btn(pyxel.GAMEPAD1_BUTTON_A):
104+
if pyxel.btn(pyxel.KEY_SPACE) or pyxel.btn(pyxel.GAMEPAD1_BUTTON_A) or pyxel.btn(pyxel.GAMEPAD1_BUTTON_B):
105105
if not self.space_pressed: # スペースが新たに押された
106106
self.space_pressed = True
107107
# 地面にいるか、空中で1回目のジャンプができるか
@@ -320,7 +320,7 @@ def reset(self):
320320
def update(self):
321321
global is_gameover
322322
if is_gameover:
323-
if pyxel.btnp(pyxel.KEY_SPACE) or pyxel.btnp(pyxel.GAMEPAD1_BUTTON_A):
323+
if pyxel.btnp(pyxel.KEY_SPACE) or pyxel.btnp(pyxel.GAMEPAD1_BUTTON_A) or pyxel.btnp(pyxel.GAMEPAD1_BUTTON_B):
324324
self.reset()
325325
return
326326

0 commit comments

Comments
 (0)