From f2319739848c3c8eaa29d6ec750848b147817387 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?b=CA=B0edoh=E2=82=82=20sw=C3=A9?= Date: Thu, 4 Apr 2024 21:17:24 +0500 Subject: [PATCH] Add strafe. --- main.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index a3b5ef0..395bd89 100755 --- a/main.py +++ b/main.py @@ -64,7 +64,7 @@ def draw(level,gPlayer,fov,res): continue if cDot(rot,MobiusAdd(cInt,-gPlayer.cPos)) > 0: continue - rDist = MobiusDist(cInt,gPlayer.cPos) + rDist = MobiusDist(cInt,gPlayer.cPos)*1.1 if not (j.isFinite and cBetween(j.pointA,j.pointB,cInt)): continue if (1 - m.height) > rDist: @@ -102,7 +102,7 @@ def mainLoop(): if event.type == pygame.QUIT: return True if event.type == pygame.KEYDOWN: - if event.key == pygame.K_q: + if event.key == pygame.K_r: gPlayer.cRot *= -1 if event.key == pygame.K_F3: debugInfo = not debugInfo @@ -111,6 +111,10 @@ def mainLoop(): gPlayer.rotate(ROT) if keys[pygame.K_a]: gPlayer.rotate(IROT) + if keys[pygame.K_q]: + gPlayer += GyroVector(OFFSET * gPlayer.cRot*I, 1) + if keys[pygame.K_e]: + gPlayer -= GyroVector(OFFSET * gPlayer.cRot*I, 1) if keys[pygame.K_w]: gPlayer -= GyroVector(OFFSET * gPlayer.cRot, 1) if keys[pygame.K_s]: