From be73b378decf4966bc0434aa9e9d048354b39102 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Thu, 9 Jul 2020 08:59:11 +0200 Subject: [PATCH] Mario --- README.md | 2 +- index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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):