Compare commits
No commits in common. "983bad10a5cfeebeeca6bdffeb2a95ad4242d64f" and "f7ee5715c77fe75db0e58739ac20fab92c27b658" have entirely different histories.
983bad10a5
...
f7ee5715c7
11
main.py
11
main.py
@ -7,7 +7,6 @@ except ImportError:
|
||||
|
||||
from time import time_ns, sleep
|
||||
from cmath import exp, pi
|
||||
from math import acos
|
||||
import pygame
|
||||
import pygame.freetype
|
||||
from gyro import *
|
||||
@ -65,7 +64,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)
|
||||
if not (j.isFinite and cBetween(j.pointA,j.pointB,cInt)):
|
||||
continue
|
||||
if (1 - m.height) > rDist:
|
||||
@ -85,7 +84,7 @@ def renderDebugInfo(gPlayer, clock, fontSize = 18):
|
||||
|
||||
fps_surf = font.render("FPS: " + str(int(clock.get_fps())), font_fg, font_bg)[0]
|
||||
cPos_surf = font.render("cPos: " + str(gPlayer.cPos), font_fg, font_bg)[0]
|
||||
cRot_surf = font.render("cRot: " + str(acos(gPlayer.cRot.real) / pi * 180), font_fg, font_bg)[0]
|
||||
cRot_surf = font.render("cRot: " + str(gPlayer.cRot), font_fg, font_bg)[0]
|
||||
|
||||
return fps_surf, cPos_surf, cRot_surf
|
||||
|
||||
@ -103,7 +102,7 @@ def mainLoop():
|
||||
if event.type == pygame.QUIT:
|
||||
return True
|
||||
if event.type == pygame.KEYDOWN:
|
||||
if event.key == pygame.K_r:
|
||||
if event.key == pygame.K_q:
|
||||
gPlayer.cRot *= -1
|
||||
if event.key == pygame.K_F3:
|
||||
debugInfo = not debugInfo
|
||||
@ -112,10 +111,6 @@ 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]:
|
||||
|
Loading…
Reference in New Issue
Block a user