diff --git a/README.md b/README.md index 5149dbc..748c8ab 100644 --- a/README.md +++ b/README.md @@ -3029,7 +3029,7 @@ def update_speed(mario, tiles, pressed): x, y = mario.spd x += 2 * ((D.e in pressed) - (D.w in pressed)) x -= x // abs(x) if x else 0 - y += 1 if D.s not in get_boundaries(mario.rect, tiles) else (-10 if D.n in pressed else 0) + y += 1 if D.s not in get_boundaries(mario.rect, tiles) else (D.n in pressed) * -10 mario.spd = P(*[max(-limit, min(limit, s)) for limit, s in zip(MAX_SPEED, P(x, y))]) def update_position(mario, tiles): diff --git a/index.html b/index.html index 80e1112..e99b60d 100644 --- a/index.html +++ b/index.html @@ -2587,7 +2587,7 @@ SIZE, MAX_SPEED = 50, P(2 * ((D.e in pressed) - (D.w in pressed)) x -= x // abs(x) if x else 0 - y += 1 if D.s not in get_boundaries(mario.rect, tiles) else (-10 if D.n in pressed else 0) + y += 1 if D.s not in get_boundaries(mario.rect, tiles) else (D.n in pressed) * -10 mario.spd = P(*[max(-limit, min(limit, s)) for limit, s in zip(MAX_SPEED, P(x, y))]) def update_position(mario, tiles):