Skip to content

Commit b780971

Browse files
committed
obstacle-race: プレーヤー停止時はアニメーションも停止
1 parent 1c2412d commit b780971

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

11-obstacle-race/main.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,12 @@ def update(self):
119119
reset()
120120

121121
def draw(self):
122-
u = (2 if self.is_falling else self.frame_count // 3 % 2) * 8
122+
if self.is_falling:
123+
u = 16
124+
elif self.dx == 0:
125+
u = 8
126+
else:
127+
u = (self.frame_count // 3 % 2) * 8
123128
w = 8 if self.direction > 0 else -8
124129
self.img.blt(self.X, self.y, 0, u, 24, w, 8, TRANSPARENT_COLOR)
125130

0 commit comments

Comments
 (0)