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: