.
This commit is contained in:
parent
3448684363
commit
1c342f163c
4
draw.py
4
draw.py
@ -22,7 +22,7 @@ class DrawnSegment:
|
|||||||
self.color = color
|
self.color = color
|
||||||
|
|
||||||
@jit#(cache=True,parallel=True)
|
@jit#(cache=True,parallel=True)
|
||||||
def draw(level,gPlayer,fov,res):
|
def draw(level,gPlayer,fov,res,dscale):
|
||||||
EMPTYDRAWN = DrawnSegment(0, BLACK)
|
EMPTYDRAWN = DrawnSegment(0, BLACK)
|
||||||
drawn = [EMPTYDRAWN] * res
|
drawn = [EMPTYDRAWN] * res
|
||||||
irot = exp(fov/res*I)
|
irot = exp(fov/res*I)
|
||||||
@ -37,7 +37,7 @@ def draw(level,gPlayer,fov,res):
|
|||||||
continue
|
continue
|
||||||
if cDot(rot,MobiusAdd(cInt,-gPlayer.cPos)) > 0:
|
if cDot(rot,MobiusAdd(cInt,-gPlayer.cPos)) > 0:
|
||||||
continue
|
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)):
|
if j.isFinite and not cBetween(Poincare2Klein(j.pointA),Poincare2Klein(j.pointB),Poincare2Klein(cInt)):
|
||||||
continue
|
continue
|
||||||
if m is None:
|
if m is None:
|
||||||
|
9
main.py
9
main.py
@ -49,6 +49,7 @@ def mainLoop():
|
|||||||
aoEngineEvents = []
|
aoEngineEvents = []
|
||||||
fvControl_ao = defaultcontrols
|
fvControl_ao = defaultcontrols
|
||||||
level = []
|
level = []
|
||||||
|
iDistScale = 1.1
|
||||||
|
|
||||||
def alert_append(alert, delay):
|
def alert_append(alert, delay):
|
||||||
if len(alerts) >= 1:
|
if len(alerts) >= 1:
|
||||||
@ -71,6 +72,7 @@ def mainLoop():
|
|||||||
nonlocal level
|
nonlocal level
|
||||||
nonlocal sky
|
nonlocal sky
|
||||||
nonlocal ground
|
nonlocal ground
|
||||||
|
nonlocal iDistScale
|
||||||
state = {
|
state = {
|
||||||
'bCap': bCap,
|
'bCap': bCap,
|
||||||
'bCont': bCont,
|
'bCont': bCont,
|
||||||
@ -84,7 +86,8 @@ def mainLoop():
|
|||||||
'aoEngineEvents': aoEngineEvents,
|
'aoEngineEvents': aoEngineEvents,
|
||||||
'level': level,
|
'level': level,
|
||||||
'sky': sky,
|
'sky': sky,
|
||||||
'ground': ground
|
'ground': ground,
|
||||||
|
'iDistScale': iDistScale
|
||||||
}
|
}
|
||||||
for i in aoEngineEvents:
|
for i in aoEngineEvents:
|
||||||
if i.sVariableToModify == "bCap":
|
if i.sVariableToModify == "bCap":
|
||||||
@ -107,6 +110,8 @@ def mainLoop():
|
|||||||
debugInfo = i.fLambda(list(map(lambda oX: state[oX], i.tsArguments)))
|
debugInfo = i.fLambda(list(map(lambda oX: state[oX], i.tsArguments)))
|
||||||
elif i.sVariableToModify == "level":
|
elif i.sVariableToModify == "level":
|
||||||
level = i.fLambda(list(map(lambda oX: state[oX], i.tsArguments)))
|
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:
|
elif i.sVariableToModify is None:
|
||||||
i.fLambda(list(map(lambda oX: state[oX], i.tsArguments)))
|
i.fLambda(list(map(lambda oX: state[oX], i.tsArguments)))
|
||||||
else:
|
else:
|
||||||
@ -135,7 +140,7 @@ def mainLoop():
|
|||||||
aoEngineEvents = fvControl_ao()
|
aoEngineEvents = fvControl_ao()
|
||||||
processevents()
|
processevents()
|
||||||
display.fill(WHITE)
|
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,sky, (0,0,1280,360))
|
||||||
pygame.draw.rect(display,ground, (0,360,1280,360))
|
pygame.draw.rect(display,ground, (0,360,1280,360))
|
||||||
n = 0
|
n = 0
|
||||||
|
Loading…
Reference in New Issue
Block a user