forked from bedohswe/p3he
.
This commit is contained in:
parent
3448684363
commit
1c342f163c
4
draw.py
4
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:
|
||||
|
9
main.py
9
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
|
||||
|
Loading…
Reference in New Issue
Block a user