From 9ebde906c28bc7be39c8a640bb985239c6235f35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?b=CA=B0edoh=E2=82=82=20sw=C3=A9?= Date: Fri, 5 Apr 2024 01:51:26 +0500 Subject: [PATCH] Slow down a bit. --- constants.py | 2 +- main.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/constants.py b/constants.py index 391f0b6..7e03d7a 100644 --- a/constants.py +++ b/constants.py @@ -3,6 +3,6 @@ from cmath import exp I = complex(0,1) WHITE = (255,255,255) BLACK = (0,0,0) -OFFSET = 0.015625 +OFFSET = 0.0078125 ROT = cNorm(exp(deg2rad(2)*I)) IROT = 1/ROT diff --git a/main.py b/main.py index 5dc7f37..d69ab27 100755 --- a/main.py +++ b/main.py @@ -32,7 +32,9 @@ def renderDebugInfo(gPlayer, clock, fontSize = 18): return fps_surf, cPos_surf, cRot_surf - +def nonzerocap(n): + if n <= 0: return 1 + return n def mainLoop(): gPlayer = GyroVector(0,1) @@ -90,7 +92,7 @@ def mainLoop(): pygame.draw.rect(display,GROUND, (0,360,1280,360)) n = 0 for i in drawn: - pygame.draw.rect(display,i.color, (n,int((cap(i.dist)) * 360),8,int(cap(1 - i.dist) * 1280))) + pygame.draw.rect(display,i.color, (n,int((nonzerocap(i.dist)) * 360),8,int((1 -nonzerocap(i.dist)) * 1280))) n += 4 gPlayer.normalize() if debugInfo: