From 1c342f163cbf28ed1a56bac6b0c32787c703fbfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?b=CA=B0edoh=E2=82=82=20sw=C3=A9?= Date: Sun, 7 Apr 2024 17:48:14 +0500 Subject: [PATCH] . --- draw.py | 4 ++-- main.py | 9 +++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/draw.py b/draw.py index b081034..2999ade 100644 --- a/draw.py +++ b/draw.py @@ -22,7 +22,7 @@ class DrawnSegment: self.color = color @jit#(cache=True,parallel=True) -def draw(level,gPlayer,fov,res): +def draw(level,gPlayer,fov,res,dscale): EMPTYDRAWN = DrawnSegment(0, BLACK) drawn = [EMPTYDRAWN] * res irot = exp(fov/res*I) @@ -37,7 +37,7 @@ def draw(level,gPlayer,fov,res): continue if cDot(rot,MobiusAdd(cInt,-gPlayer.cPos)) > 0: continue - rDist = MobiusDist(cInt,gPlayer.cPos)*1.1 + rDist = MobiusDist(cInt,gPlayer.cPos) * dscale if j.isFinite and not cBetween(Poincare2Klein(j.pointA),Poincare2Klein(j.pointB),Poincare2Klein(cInt)): continue if m is None: diff --git a/main.py b/main.py index 8f8ce0f..0f845c4 100755 --- a/main.py +++ b/main.py @@ -49,6 +49,7 @@ def mainLoop(): aoEngineEvents = [] fvControl_ao = defaultcontrols level = [] + iDistScale = 1.1 def alert_append(alert, delay): if len(alerts) >= 1: @@ -71,6 +72,7 @@ def mainLoop(): nonlocal level nonlocal sky nonlocal ground + nonlocal iDistScale state = { 'bCap': bCap, 'bCont': bCont, @@ -84,7 +86,8 @@ def mainLoop(): 'aoEngineEvents': aoEngineEvents, 'level': level, 'sky': sky, - 'ground': ground + 'ground': ground, + 'iDistScale': iDistScale } for i in aoEngineEvents: if i.sVariableToModify == "bCap": @@ -107,6 +110,8 @@ def mainLoop(): debugInfo = i.fLambda(list(map(lambda oX: state[oX], i.tsArguments))) elif i.sVariableToModify == "level": level = i.fLambda(list(map(lambda oX: state[oX], i.tsArguments))) + elif i.sVariableToModify == "iDistScale": + iDistScale = i.fLambda(list(map(lambda oX: state[oX], i.tsArguments))) elif i.sVariableToModify is None: i.fLambda(list(map(lambda oX: state[oX], i.tsArguments))) else: @@ -135,7 +140,7 @@ def mainLoop(): aoEngineEvents = fvControl_ao() processevents() display.fill(WHITE) - drawn = draw(level,gPlayer,pi/4,320) + drawn = draw(level,gPlayer,pi/4,320,iDistScale) pygame.draw.rect(display,sky, (0,0,1280,360)) pygame.draw.rect(display,ground, (0,360,1280,360)) n = 0